File Editor
Directories:
.. (Back)
ajax
capabilities
endpoints
exceptions
filters
formatter
google_search_console
import
listeners
menu
metabox
notifiers
pages
roles
services
statistics
taxonomy
tracking
views
watchers
Files:
admin-settings-changed-listener.php
ajax.php
class-admin-asset-analysis-worker-location.php
class-admin-asset-dev-server-location.php
class-admin-asset-location.php
class-admin-asset-manager.php
class-admin-asset-seo-location.php
class-admin-editor-specific-replace-vars.php
class-admin-gutenberg-compatibility-notification.php
class-admin-help-panel.php
class-admin-init.php
class-admin-recommended-replace-vars.php
class-admin-user-profile.php
class-admin-utils.php
class-admin.php
class-asset.php
class-bulk-description-editor-list-table.php
class-bulk-editor-list-table.php
class-bulk-title-editor-list-table.php
class-collector.php
class-config.php
class-database-proxy.php
class-export.php
class-expose-shortlinks.php
class-gutenberg-compatibility.php
class-meta-columns.php
class-my-yoast-proxy.php
class-option-tab.php
class-option-tabs-formatter.php
class-option-tabs.php
class-paper-presenter.php
class-plugin-availability.php
class-plugin-conflict.php
class-premium-popup.php
class-premium-upsell-admin-block.php
class-primary-term-admin.php
class-product-upsell-notice.php
class-remote-request.php
class-schema-person-upgrade-notification.php
class-suggested-plugins.php
class-wincher-dashboard-widget.php
class-yoast-columns.php
class-yoast-dashboard-widget.php
class-yoast-form.php
class-yoast-input-validation.php
class-yoast-network-admin.php
class-yoast-network-settings-api.php
class-yoast-notification-center.php
class-yoast-notification.php
class-yoast-notifications.php
class-yoast-plugin-conflict.php
index.php
interface-collection.php
interface-installable.php
Create New File
Create
Edit File: class-admin-help-panel.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin */ /** * Generates the HTML for an inline Help Button and Panel. */ class WPSEO_Admin_Help_Panel { /** * Unique identifier of the element the inline help refers to, used as an identifier in the html. * * @var string */ private $id; /** * The Help Button text. Needs a properly escaped string. * * @var string */ private $help_button_text; /** * The Help Panel content. Needs a properly escaped string (might contain HTML). * * @var string */ private $help_content; /** * Optional Whether to print out a container div element for the Help Panel, used for styling. * * @var string */ private $wrapper; /** * Constructor. * * @param string $id Unique identifier of the element the inline help refers to, used as * an identifier in the html. * @param string $help_button_text The Help Button text. Needs a properly escaped string. * @param string $help_content The Help Panel content. Needs a properly escaped string (might contain HTML). * @param string $wrapper Optional Whether to print out a container div element for the Help Panel, * used for styling. * Pass a `has-wrapper` value to print out the container. Default: no container. */ public function __construct( $id, $help_button_text, $help_content, $wrapper = '' ) { $this->id = $id; $this->help_button_text = $help_button_text; $this->help_content = $help_content; $this->wrapper = $wrapper; } /** * Returns the html for the Help Button. * * @return string */ public function get_button_html() { if ( ! $this->id || ! $this->help_button_text || ! $this->help_content ) { return ''; } return sprintf( ' <button type="button" class="yoast_help yoast-help-button dashicons" id="%1$s-help-toggle" aria-expanded="false" aria-controls="%1$s-help"><span class="yoast-help-icon" aria-hidden="true"></span><span class="screen-reader-text">%2$s</span></button>', esc_attr( $this->id ), $this->help_button_text ); } /** * Returns the html for the Help Panel. * * @return string */ public function get_panel_html() { if ( ! $this->id || ! $this->help_button_text || ! $this->help_content ) { return ''; } $wrapper_start = ''; $wrapper_end = ''; if ( $this->wrapper === 'has-wrapper' ) { $wrapper_start = '<div class="yoast-seo-help-container">'; $wrapper_end = '</div>'; } return sprintf( '%1$s<p id="%2$s-help" class="yoast-help-panel">%3$s</p>%4$s', $wrapper_start, esc_attr( $this->id ), $this->help_content, $wrapper_end ); } }
Save Changes
Rename File
Rename