:
id="get_field_id('image'); ?>" name="get_field_name('image'); ?>" />
id="get_field_id('date-stamp'); ?>" name="get_field_name('date-stamp'); ?>" /> ' . __('* If the "Show Thumbnail" option is disabled or no featured image is set, the date stamp will be displayed.', 'flatsome') . '
: $value) { echo ''.$value.''; } ?>
UX Blocks can be edited with the UX Builder when you hover over them in the front-end.Learn more about UX Blocks
'.wp_kses_post($field['label']).' '; if ( ! empty( $field['description'] ) ) { if ( isset( $field['desc_tip'] ) && false !== $field['desc_tip'] ) { echo ''; } else { echo '' . wp_kses_post( $field['description'] ) . ''; } } echo '
'.$field['label'].''.esc_textarea($inputval).'</textarea>'; if ( ! empty( $field['description'] ) ) { if ( isset( $field['desc_tip'] ) && false !== $field['desc_tip'] ) { echo ''; } else { echo '' . wp_kses_post( $field['description'] ) . ''; } } echo '
' . wp_kses_post( $field['label'] ) . ' '; if ( ! empty( $field['description'] ) ) { if ( isset( $field['desc_tip'] ) && false !== $field['desc_tip'] ) { echo ''; } else { echo '' . wp_kses_post( $field['description'] ) . ''; } } echo '
' . wp_kses_post( $field['label'] ) . ''; foreach ( $field['options'] as $key => $value ) { echo '' . esc_html( $value ) . ''; } echo ' '; if ( ! empty( $field['description'] ) ) { if ( isset( $field['desc_tip'] ) && false !== $field['desc_tip'] ) { echo ''; } else { echo '' . wp_kses_post( $field['description'] ) . ''; } } echo '
'.$field['label'].''; $html .= ''; $html .= ''; $saved_val = $wc_cpdf->get_value($thepostid, $field['id']) ? $wc_cpdf->get_value($thepostid, $field['id']) : array(); foreach ( $field['options'] as $key => $value ) { $html .= '' . esc_html( $value ) . ''; } $html .= ''; if ( ! empty( $field['description'] ) ) { if ( isset( $field['desc_tip'] ) && false !== $field['desc_tip'] ) { $html .= ''; } else { $html .= '' . wp_kses_post( $field['description'] ) . ''; } } $html .= '
', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '' ), '
', esc_html( $this->strings['return'] ), '
', wp_kses_post( $activate->get_error_message() ), '
', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.
', esc_html( $this->strings['plugin_activated'] ), '
', sprintf( esc_html( $this->strings['plugin_already_active'] ), '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' ), '
', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' ), '
', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '
and as the final message can't be // filtered, using
's in our html would render invalid html output. $line_template = '%s' . "\n"; if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) { $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] ); $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template ); } else { // If dismissable is false and a message is set, output it now. if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); } // Render the individual message lines for the notice. foreach ( $message as $type => $plugin_group ) { $linked_plugins = array(); // Get the external info link for a plugin if one is available. foreach ( $plugin_group as $plugin_slug ) { $linked_plugins[] = $this->get_info_link( $plugin_slug ); } unset( $plugin_slug ); $count = count( $plugin_group ); $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin ); $rendered .= sprintf( $line_template, sprintf( translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ), $imploded, $count ) ); } unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template ); } // Register the nag messages and prepare them to be processed. add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() ); } // Admin options pages already output settings_errors, so this is to avoid duplication. if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { $this->display_settings_errors(); } } /** * Generate the user action links for the admin notice. * * @since 2.6.0 * * @param int $install_count Number of plugins to install. * @param int $update_count Number of plugins to update. * @param int $activate_count Number of plugins to activate. * @param int $line_template Template for the HTML tag to output a line. * @return string Action links. */ protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) { // Setup action links. $action_links = array( 'install' => '', 'update' => '', 'activate' => '', 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', ); $link_template = '%1$s'; if ( current_user_can( 'install_plugins' ) ) { if ( $install_count > 0 ) { $action_links['install'] = sprintf( $link_template, translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ), esc_url( $this->get_tgmpa_status_url( 'install' ) ) ); } if ( $update_count > 0 ) { $action_links['update'] = sprintf( $link_template, translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ), esc_url( $this->get_tgmpa_status_url( 'update' ) ) ); } } if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) { $action_links['activate'] = sprintf( $link_template, translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ), esc_url( $this->get_tgmpa_status_url( 'activate' ) ) ); } $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); $action_links = array_filter( (array) $action_links ); // Remove any empty array items. if ( ! empty( $action_links ) ) { $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); } else { return ''; } } /** * Get admin notice class. * * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7 * (lowest supported version by TGMPA). * * @since 2.6.0 * * @return string */ protected function get_admin_notice_class() { if ( ! empty( $this->strings['nag_type'] ) ) { return sanitize_html_class( strtolower( $this->strings['nag_type'] ) ); } else { if ( version_compare( $this->wp_version, '4.2', '>=' ) ) { return 'notice-warning'; } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) { return 'notice'; } else { return 'updated'; } } } /** * Display settings errors and remove those which have been displayed to avoid duplicate messages showing * * @since 2.5.0 */ protected function display_settings_errors() { global $wp_settings_errors; settings_errors( 'tgmpa' ); foreach ( (array) $wp_settings_errors as $key => $details ) { if ( 'tgmpa' === $details['setting'] ) { unset( $wp_settings_errors[ $key ] ); break; } } } /** * Register dismissal of admin notices. * * Acts on the dismiss link in the admin nag messages. * If clicked, the admin notice disappears and will no longer be visible to this user. * * @since 2.1.0 */ public function dismiss() { if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) { update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); } } /** * Add individual plugin to our collection of plugins. * * If the required keys are not set or the plugin has already * been registered, the plugin is not added. * * @since 2.0.0 * * @param array|null $plugin Array of plugin arguments or null if invalid argument. * @return null Return early if incorrect argument. */ public function register( $plugin ) { if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { return; } if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { return; } $defaults = array( 'name' => '', // String 'slug' => '', // String 'source' => 'repo', // String 'required' => false, // Boolean 'version' => '', // String 'force_activation' => false, // Boolean 'force_deactivation' => false, // Boolean 'external_url' => '', // String 'is_callable' => '', // String|Array. ); // Prepare the received data. $plugin = wp_parse_args( $plugin, $defaults ); // Standardize the received slug. $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); // Forgive users for using string versions of booleans or floats for version number. $plugin['version'] = (string) $plugin['version']; $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); // Enrich the received data. $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); // Set the class properties. $this->plugins[ $plugin['slug'] ] = $plugin; $this->sort_order[ $plugin['slug'] ] = $plugin['name']; // Should we add the force activation hook ? if ( true === $plugin['force_activation'] ) { $this->has_forced_activation = true; } // Should we add the force deactivation hook ? if ( true === $plugin['force_deactivation'] ) { $this->has_forced_deactivation = true; } } /** * Determine what type of source the plugin comes from. * * @since 2.5.0 * * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path * (= bundled) or an external URL. * @return string 'repo', 'external', or 'bundled' */ protected function get_plugin_source_type( $source ) { if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { return 'repo'; } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { return 'external'; } else { return 'bundled'; } } /** * Sanitizes a string key. * * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase * characters in the plugin directory path/slug. Silly them. * * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ * * @since 2.5.0 * * @param string $key String key. * @return string Sanitized key */ public function sanitize_key( $key ) { $raw_key = $key; $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); /** * Filter a sanitized key string. * * @since 2.5.0 * * @param string $key Sanitized key. * @param string $raw_key The key prior to sanitization. */ return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); } /** * Amend default configuration settings. * * @since 2.0.0 * * @param array $config Array of config options to pass as class properties. */ public function config( $config ) { $keys = array( 'id', 'default_path', 'has_notices', 'dismissable', 'dismiss_msg', 'menu', 'parent_slug', 'capability', 'is_automatic', 'message', 'strings', ); foreach ( $keys as $key ) { if ( isset( $config[ $key ] ) ) { if ( is_array( $config[ $key ] ) ) { $this->$key = array_merge( $this->$key, $config[ $key ] ); } else { $this->$key = $config[ $key ]; } } } } /** * Amend action link after plugin installation. * * @since 2.0.0 * * @param array $install_actions Existing array of actions. * @return false|array Amended array of actions. */ public function actions( $install_actions ) { // Remove action links on the TGMPA install page. if ( $this->is_tgmpa_page() ) { return false; } return $install_actions; } /** * Flushes the plugins cache on theme switch to prevent stale entries * from remaining in the plugin table. * * @since 2.4.0 * * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. * Parameter added in v2.5.0. */ public function flush_plugins_cache( $clear_update_cache = true ) { wp_clean_plugins_cache( $clear_update_cache ); } /** * Set file_path key for each installed plugin. * * @since 2.1.0 * * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. * Parameter added in v2.5.0. */ public function populate_file_path( $plugin_slug = '' ) { if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); } else { // Add file_path key for all plugins. foreach ( $this->plugins as $slug => $values ) { $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); } } } /** * Helper function to extract the file path of the plugin file from the * plugin slug, if the plugin is installed. * * @since 2.0.0 * * @param string $slug Plugin slug (typically folder name) as provided by the developer. * @return string Either file path for plugin if installed, or just the plugin slug. */ protected function _get_plugin_basename_from_slug( $slug ) { $keys = array_keys( $this->get_plugins() ); foreach ( $keys as $key ) { if ( preg_match( '|^' . $slug . '/|', $key ) ) { return $key; } } return $slug; } /** * Retrieve plugin data, given the plugin name. * * Loops through the registered plugins looking for $name. If it finds it, * it returns the $data from that plugin. Otherwise, returns false. * * @since 2.1.0 * * @param string $name Name of the plugin, as it was registered. * @param string $data Optional. Array key of plugin data to return. Default is slug. * @return string|boolean Plugin slug if found, false otherwise. */ public function _get_plugin_data_from_name( $name, $data = 'slug' ) { foreach ( $this->plugins as $values ) { if ( $name === $values['name'] && isset( $values[ $data ] ) ) { return $values[ $data ]; } } return false; } /** * Retrieve the download URL for a package. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Plugin download URL or path to local file or empty string if undetermined. */ public function get_download_url( $slug ) { $dl_source = ''; switch ( $this->plugins[ $slug ]['source_type'] ) { case 'repo': return $this->get_wp_repo_download_url( $slug ); case 'external': return $this->plugins[ $slug ]['source']; case 'bundled': return $this->default_path . $this->plugins[ $slug ]['source']; } return $dl_source; // Should never happen. } /** * Retrieve the download URL for a WP repo package. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Plugin download URL. */ protected function get_wp_repo_download_url( $slug ) { $source = ''; $api = $this->get_plugins_api( $slug ); if ( false !== $api && isset( $api->download_link ) ) { $source = $api->download_link; } return $source; } /** * Try to grab information from WordPress API. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return object Plugins_api response object on success, WP_Error on failure. */ protected function get_plugins_api( $slug ) { static $api = array(); // Cache received responses. if ( ! isset( $api[ $slug ] ) ) { if ( ! function_exists( 'plugins_api' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; } $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); $api[ $slug ] = false; if ( is_wp_error( $response ) ) { wp_die( esc_html( $this->strings['oops'] ) ); } else { $api[ $slug ] = $response; } } return $api[ $slug ]; } /** * Retrieve a link to a plugin information page. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Fully formed html link to a plugin information page if available * or the plugin name if not. */ public function get_info_link( $slug ) { if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { $link = sprintf( '%2$s', esc_url( $this->plugins[ $slug ]['external_url'] ), esc_html( $this->plugins[ $slug ]['name'] ) ); } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { $url = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => urlencode( $slug ), 'TB_iframe' => 'true', 'width' => '640', 'height' => '500', ), self_admin_url( 'plugin-install.php' ) ); $link = sprintf( '%2$s', esc_url( $url ), esc_html( $this->plugins[ $slug ]['name'] ) ); } else { $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. } return $link; } /** * Determine if we're on the TGMPA Install page. * * @since 2.1.0 * * @return boolean True when on the TGMPA page, false otherwise. */ protected function is_tgmpa_page() { return isset( $_GET['page'] ) && $this->menu === $_GET['page']; } /** * Determine if we're on a WP Core installation/upgrade page. * * @since 2.6.0 * * @return boolean True when on a WP Core installation/upgrade page, false otherwise. */ protected function is_core_update_page() { // Current screen is not always available, most notably on the customizer screen. if ( ! function_exists( 'get_current_screen' ) ) { return false; } $screen = get_current_screen(); if ( 'update-core' === $screen->base ) { // Core update screen. return true; } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. // Plugins bulk update screen. return true; } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. // Individual updates (ajax call). return true; } return false; } /** * Retrieve the URL to the TGMPA Install page. * * I.e. depending on the config settings passed something along the lines of: * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins * * @since 2.5.0 * * @return string Properly encoded URL (not escaped). */ public function get_tgmpa_url() { static $url; if ( ! isset( $url ) ) { $parent = $this->parent_slug; if ( false === strpos( $parent, '.php' ) ) { $parent = 'admin.php'; } $url = add_query_arg( array( 'page' => urlencode( $this->menu ), ), self_admin_url( $parent ) ); } return $url; } /** * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). * * I.e. depending on the config settings passed something along the lines of: * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install * * @since 2.5.0 * * @param string $status Plugin status - either 'install', 'update' or 'activate'. * @return string Properly encoded URL (not escaped). */ public function get_tgmpa_status_url( $status ) { return add_query_arg( array( 'plugin_status' => urlencode( $status ), ), $this->get_tgmpa_url() ); } /** * Determine whether there are open actions for plugins registered with TGMPA. * * @since 2.5.0 * * @return bool True if complete, i.e. no outstanding actions. False otherwise. */ public function is_tgmpa_complete() { $complete = true; foreach ( $this->plugins as $slug => $plugin ) { if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { $complete = false; break; } } return $complete; } /** * Check if a plugin is installed. Does not take must-use plugins into account. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if installed, false otherwise. */ public function is_plugin_installed( $slug ) { $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); } /** * Check if a plugin is active. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if active, false otherwise. */ public function is_plugin_active( $slug ) { return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); } /** * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required * available, check whether the current install meets them. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if OK to update, false otherwise. */ public function can_plugin_update( $slug ) { // We currently can't get reliable info on non-WP-repo plugins - issue #380. if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { return true; } $api = $this->get_plugins_api( $slug ); if ( false !== $api && isset( $api->requires ) ) { return version_compare( $this->wp_version, $api->requires, '>=' ); } // No usable info received from the plugins API, presume we can update. return true; } /** * Check to see if the plugin is 'updatetable', i.e. installed, with an update available * and no WP version requirements blocking it. * * @since 2.6.0 * * @param string $slug Plugin slug. * @return bool True if OK to proceed with update, false otherwise. */ public function is_plugin_updatetable( $slug ) { if ( ! $this->is_plugin_installed( $slug ) ) { return false; } else { return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) ); } } /** * Check if a plugin can be activated, i.e. is not currently active and meets the minimum * plugin version requirements set in TGMPA (if any). * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True if OK to activate, false otherwise. */ public function can_plugin_activate( $slug ) { return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); } /** * Retrieve the version number of an installed plugin. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string Version number as string or an empty string if the plugin is not installed * or version unknown (plugins which don't comply with the plugin header standard). */ public function get_installed_version( $slug ) { $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; } return ''; } /** * Check whether a plugin complies with the minimum version requirements. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return bool True when a plugin needs to be updated, otherwise false. */ public function does_plugin_require_update( $slug ) { $installed_version = $this->get_installed_version( $slug ); $minimum_version = $this->plugins[ $slug ]['version']; return version_compare( $minimum_version, $installed_version, '>' ); } /** * Check whether there is an update available for a plugin. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return false|string Version number string of the available update or false if no update available. */ public function does_plugin_have_update( $slug ) { // Presume bundled and external plugins will point to a package which meets the minimum required version. if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { if ( $this->does_plugin_require_update( $slug ) ) { return $this->plugins[ $slug ]['version']; } return false; } $repo_updates = get_site_transient( 'update_plugins' ); if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; } return false; } /** * Retrieve potential upgrade notice for a plugin. * * @since 2.5.0 * * @param string $slug Plugin slug. * @return string The upgrade notice or an empty string if no message was available or provided. */ public function get_upgrade_notice( $slug ) { // We currently can't get reliable info on non-WP-repo plugins - issue #380. if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { return ''; } $repo_updates = get_site_transient( 'update_plugins' ); if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; } return ''; } /** * Wrapper around the core WP get_plugins function, making sure it's actually available. * * @since 2.5.0 * * @param string $plugin_folder Optional. Relative path to single plugin folder. * @return array Array of installed plugins with plugin information. */ public function get_plugins( $plugin_folder = '' ) { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } return get_plugins( $plugin_folder ); } /** * Delete dismissable nag option when theme is switched. * * This ensures that the user(s) is/are again reminded via nag of required * and/or recommended plugins if they re-activate the theme. * * @since 2.1.1 */ public function update_dismiss() { delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); } /** * Forces plugin activation if the parameter 'force_activation' is * set to true. * * This allows theme authors to specify certain plugins that must be * active at all times while using the current theme. * * Please take special care when using this parameter as it has the * potential to be harmful if not used correctly. Setting this parameter * to true will not allow the specified plugin to be deactivated unless * the user switches themes. * * @since 2.2.0 */ public function force_activation() { foreach ( $this->plugins as $slug => $plugin ) { if ( true === $plugin['force_activation'] ) { if ( ! $this->is_plugin_installed( $slug ) ) { // Oops, plugin isn't there so iterate to next condition. continue; } elseif ( $this->can_plugin_activate( $slug ) ) { // There we go, activate the plugin. activate_plugin( $plugin['file_path'] ); } } } } /** * Forces plugin deactivation if the parameter 'force_deactivation' * is set to true and adds the plugin to the 'recently active' plugins list. * * This allows theme authors to specify certain plugins that must be * deactivated upon switching from the current theme to another. * * Please take special care when using this parameter as it has the * potential to be harmful if not used correctly. * * @since 2.2.0 */ public function force_deactivation() { $deactivated = array(); foreach ( $this->plugins as $slug => $plugin ) { /* * Only proceed forward if the parameter is set to true and plugin is active * as a 'normal' (not must-use) plugin. */ if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { deactivate_plugins( $plugin['file_path'] ); $deactivated[ $plugin['file_path'] ] = time(); } } if ( ! empty( $deactivated ) ) { update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); } } /** * Echo the current TGMPA version number to the page. * * @since 2.5.0 */ public function show_tgmpa_version() { echo '
', esc_html( sprintf( /* translators: %s: version number */ __( 'TGMPA v%s', 'tgmpa' ), self::TGMPA_VERSION ) ), '
%2$s' . __( 'Installed version:', 'tgmpa' ) . '
%1$s' . __( 'Minimum required version:', 'tgmpa' ) . '
%2$s' . __( 'Available version:', 'tgmpa' ) . '
', esc_html( $message ), '
', esc_html__( 'No plugins were selected to be activated. No action taken.', 'tgmpa' ), '
', esc_html__( 'No plugins are available to be activated at this time.', 'tgmpa' ), '
%1$s %2$s.
' . esc_html( $override['file'] ) . '
> > > > field_description( __( 'Select dropdown design.', 'flatsome' ) ); ?>
(px)
> ux_blocks as $block_id => $title ) : ?> > field_description( 'Select UX Block as dropdown content.' ); ?>
> >
media_view_html( $item_id, $icon_id, 'icon-id' ); ?>
(px) (px) field_description( __( 'Icons default (empty) to 20x20.', 'flatsome' ) ); ?>
</textarea> field_description( __( 'Add any HTML, SVG or shortcode here.', 'flatsome' ) ); ?>
'. __('Last Backup : ', 'flatsome-admin').''.$log.'
'. $g_text .'
'; $output .= ''. $on .''; $output .= ''. $off .''; $output .= ''; $output .= ''; $output .= '
Upgrade your version of WordPress for full media support.
Use with caution! Disable if you have plugin compatibility problems.
Fetch content from the server without reloading the whole page. This is an experimental feature and is subject to change. Disable if you experience plugin compatibility issues.
Learn more
Access mode: %s
Additional options for integrated plugins will be shown here if they are activated.
Use with caution. Do not use prerelease versions on production sites. Beta releases may not be stable.
', '' ); ?>
get_error_message() ?>
' + error + '