/** * Output the settings. */ public function output() { global $current_section; $integrations = AC()->integrations->get_integrations(); if (isset($integrations[$current_section])) { $integrations[$current_section]->admin_options(); } }
/** * Test - install */ public function test_install() { // Clean existing install first if (!defined('WP_UNINSTALL_PLUGIN')) { define('WP_UNINSTALL_PLUGIN', true); define('AC_REMOVE_ALL_DATA', true); } include dirname(dirname(dirname(dirname(__FILE__)))) . '/uninstall.php'; AC_Install::install(); $this->assertTrue(get_option('axiscomposer_version') === AC()->version); }
/** * TinyMCE Plugin Translation. * @return string $translated TinyMCE language strings. */ function axiscomposer_tinymce_plugin_translation() { // Default TinyMCE strings. $mce_translation = array('shortcode_title' => __('Insert AxisComposer Shortcode', 'axiscomposer'), 'layout_label' => __('Layout Elements', 'axiscomposer'), 'content_label' => __('Content Elements', 'axiscomposer'), 'media_label' => __('Media Elements', 'axiscomposer'), 'plugin_label' => __('Plugin Additions', 'axiscomposer')); // Fetch all necessary shortcodes information. $mce_translation['shortcodes'] = AC()->shortcodes->get_mce_shortcodes(); /** * Filter translated strings prepared for TinyMCE. * @param array $mce_translation Key/value pairs of strings. * @since 1.0.0 */ $mce_translation = apply_filters('axiscomposer_mce_translations', $mce_translation); $mce_locale = _WP_Editors::$mce_locale; $translated = 'tinyMCE.addI18n("' . $mce_locale . '.axiscomposer_shortcodes", ' . json_encode($mce_translation) . ");\n"; return $translated; }
/** * Return data for script handles. * @access private * @param string $handle * @return array|bool */ private static function get_script_data($handle) { switch ($handle) { case 'axiscomposer': return array('ajax_url' => AC()->ajax_url()); break; case 'axiscomposer-enhanced-select': return array('i18n_select_option_text' => esc_attr__('Select an option…', 'axiscomposer'), 'i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'axiscomposer'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'axiscomposer'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'axiscomposer'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'axiscomposer'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'axiscomposer'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'axiscomposer'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'axiscomposer'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'axiscomposer'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'axiscomposer'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'axiscomposer'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'axiscomposer'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'axiscomposer')); break; } return false; }
/** * Output a Pagebuilder Shortcode Templates. */ public function print_media_templates() { $tmpl_id = $this->shortcode['name']; $template = $this->prepare_editor_element(); if (is_array($template)) { foreach ($template as $value) { $template = $value; continue; } } include AC()->plugin_path() . '/includes/shortcodes/views/html-admin-tmpl-shortcodes.php'; }
/** * Enqueue scripts. */ public function admin_scripts() { global $post; $screen = get_current_screen(); $screen_id = $screen ? $screen->id : ''; $status = get_option('axiscomposer_status_options', array()); $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; // Register Scripts wp_register_script('axiscomposer-admin', AC()->plugin_url() . '/assets/js/admin/admin' . $suffix . '.js', array('jquery', 'jquery-blockui', 'jquery-ui-sortable', 'jquery-ui-widget', 'jquery-ui-core', 'jquery-tiptip'), AC_VERSION); wp_register_script('ac-admin-meta-boxes', AC()->plugin_url() . '/assets/js/admin/meta-boxes' . $suffix . '.js', array('jquery', 'jquery-blockui', 'wp-color-picker', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'jquery-ui-droppable', 'jquery-tiptip', 'ac-enhanced-select', 'plupload-all', 'stupidtable'), AC_VERSION); wp_register_script('jquery-blockui', AC()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array('jquery'), '2.70', true); wp_register_script('jquery-tiptip', AC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array('jquery'), AC_VERSION, true); wp_register_script('zeroclipboard', AC()->plugin_url() . '/assets/js/zeroclipboard/jquery.zeroclipboard' . $suffix . '.js', array('jquery'), AC_VERSION); wp_register_script('stupidtable', AC()->plugin_url() . '/assets/js/stupidtable/stupidtable' . $suffix . '.js', array('jquery'), AC_VERSION); wp_register_script('serializejson', AC()->plugin_url() . '/assets/js/jquery-serializejson/jquery.serializejson' . $suffix . '.js', array('jquery'), '2.6.1'); wp_register_script('select2', AC()->plugin_url() . '/assets/js/select2/select2' . $suffix . '.js', array('jquery'), '3.5.4'); wp_register_script('ac-backbone-modal', AC()->plugin_url() . '/assets/js/admin/backbone-modal' . $suffix . '.js', array('underscore', 'backbone', 'wp-util'), AC_VERSION); wp_register_script('ac-enhanced-select', AC()->plugin_url() . '/assets/js/admin/enhanced-select' . $suffix . '.js', array('jquery', 'select2'), AC_VERSION); wp_localize_script('ac-enhanced-select', 'ac_enhanced_select_params', array('ajax_url' => admin_url('admin-ajax.php'), 'search_post_types_nonce' => wp_create_nonce('search-post-types'), 'i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'axiscomposer'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'axiscomposer'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'axiscomposer'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'axiscomposer'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'axiscomposer'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'axiscomposer'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'axiscomposer'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'axiscomposer'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'axiscomposer'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'axiscomposer'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'axiscomposer'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'axiscomposer'))); // AxisComposer admin pages if (in_array($screen_id, ac_get_screen_ids())) { wp_enqueue_script('iris'); wp_enqueue_script('axiscomposer-admin'); wp_enqueue_script('ac-enhanced-select'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-ui-autocomplete'); $params = array('ajax_url' => admin_url('admin-ajax.php')); wp_localize_script('axiscomposer-admin', 'axiscomposer_admin', $params); } // Meta boxes if (in_array($screen_id, ac_get_allowed_screen_types())) { wp_register_script('ac-admin-pagebuilder-meta-boxes', AC()->plugin_url() . '/assets/js/admin/meta-boxes-pagebuilder' . $suffix . '.js', array('ac-admin-meta-boxes', 'ac-backbone-modal', 'shortcode', 'serializejson', 'media-models'), AC_VERSION); wp_register_script('ac-admin-pagebuilder-meta-boxes-position', AC()->plugin_url() . '/assets/js/admin/meta-boxes-pagebuilder-position' . $suffix . '.js', array('ac-admin-meta-boxes'), AC_VERSION); wp_enqueue_script('ac-admin-pagebuilder-meta-boxes'); wp_enqueue_script('ac-admin-pagebuilder-meta-boxes-position'); $params = array('post_id' => isset($post->ID) ? $post->ID : '', 'ajax_url' => admin_url('admin-ajax.php'), 'plugin_url' => AC()->plugin_url(), 'debug_mode' => true === AC_BUILDER_DEBUG_MODE ? 'no' : 'yes', 'modal_item_nonce' => wp_create_nonce('modal-item'), 'i18n_css_error' => esc_js(__('Please enter in a value without any invalid or special characters.', 'axiscomposer')), 'i18n_gist_error' => esc_js(__('Please enter in a value without any whitespace or special characters.', 'axiscomposer')), 'i18n_no_layout' => esc_js(__('The current number of cells does not allow any layout variations.', 'axiscomposer')), 'i18n_add_one_cell' => esc_js(__('You need to add at least one cell', 'axiscomposer')), 'i18n_remove_one_cell' => esc_js(__('You need to remove at least one cell', 'axiscomposer')), 'i18n_select_cell_layout' => esc_js(__('Select a cell layout', 'axiscomposer')), 'i18n_trash_elements_title' => esc_js(__('Permanently Delete all Canvas Elements', 'axiscomposer')), 'i18n_trash_elements_least' => esc_js(sprintf(__('You need to add at least one canvas element below for this action. %sYour history session has beeen reset :)%s', 'axiscomposer'), '<br /><mark class="yes">', '</mark>')), 'i18n_trash_elements_notice' => esc_js(sprintf(__('All Page Builder content will be permanently lost and cannot be undone. %sAre you positive you want to delete all canvas elements?%s', 'axiscomposer'), '<br /><mark class="no">', '</mark>')), 'i18n_backbone_loading_falied' => esc_js(__('Loading failed - Your session timed out. Please reload the page and try again.', 'axiscomposer')), 'i18n_backbone_dismiss_button' => esc_js(__('Dismiss', 'axiscomposer'))); wp_localize_script('ac-admin-pagebuilder-meta-boxes', 'axiscomposer_admin_meta_boxes_pagebuilder', $params); } if (in_array($screen_id, ac_get_layout_supported_screens())) { wp_register_script('ac-admin-layout-meta-boxes', AC()->plugin_url() . '/assets/js/admin/meta-boxes-layout' . $suffix . '.js', array('ac-admin-meta-boxes'), AC_VERSION); wp_enqueue_script('ac-admin-layout-meta-boxes'); } // System status if ('axiscomposer_page_ac-status' === $screen_id) { wp_enqueue_script('zeroclipboard'); } // Widgets Specific if (in_array($screen_id, array('widgets')) && 'yes' === get_option('axiscomposer_sidebar_enabled', 'yes')) { wp_register_script('ac-admin-sidebars', AC()->plugin_url() . '/assets/js/admin/sidebars' . $suffix . '.js', array('ac-backbone-modal'), AC_VERSION); wp_enqueue_script('ac-admin-sidebars'); wp_localize_script('ac-admin-sidebars', 'axiscomposer_admin_sidebars', array('ajax_url' => admin_url('admin-ajax.php'), 'delete_custom_sidebar_nonce' => wp_create_nonce('delete-custom-sidebar'))); } // Iconfonts Specific if (in_array($screen_id, array('axiscomposer_page_ac-iconfont'))) { wp_enqueue_media(); wp_register_script('ac-admin-iconfont', AC()->plugin_url() . '/assets/js/admin/iconfont' . $suffix . '.js', array('jquery', 'underscore', 'backbone'), AC_VERSION); wp_enqueue_script('media-upload'); wp_enqueue_script('ac-admin-iconfont'); $params = array('ajax_url' => admin_url('admin-ajax.php'), 'add_custom_iconfont_nonce' => wp_create_nonce('add-custom-iconfont'), 'delete_custom_iconfont_nonce' => wp_create_nonce('delete-custom-iconfont')); wp_localize_script('ac-admin-iconfont', 'axiscomposer_admin_iconfont', $params); } }
</tr> <?php $posting = array(); // Multibyte String. $posting['mbstring']['name'] = 'Multibyte String'; $posting['mbstring']['help'] = ac_help_tip(__('Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'axiscomposer')); if (extension_loaded('mbstring')) { $posting['mbstring']['success'] = true; } else { $posting['mbstring']['success'] = false; $posting['mbstring']['note'] = sprintf(__('Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'axiscomposer'), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>'); } // WP Remote Post Check. $posting['wp_remote_post']['name'] = __('Remote Post', 'axiscomposer'); $posting['wp_remote_post']['help'] = ac_help_tip(__('AxisComposer plugins may uses this method of communication when sending back information.', 'axiscomposer')); $response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array('timeout' => 60, 'user-agent' => 'AxisComposer/' . AC()->version, 'httpversion' => '1.1', 'body' => array('cmd' => '_notify-validate'))); if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { $posting['wp_remote_post']['success'] = true; } else { $posting['wp_remote_post']['note'] = __('wp_safe_remote_post() failed. Contact your hosting provider.', 'axiscomposer'); if (is_wp_error($response)) { $posting['wp_remote_post']['note'] .= ' ' . sprintf(__('Error: %s', 'axiscomposer'), ac_clean($response->get_error_message())); } else { $posting['wp_remote_post']['note'] .= ' ' . sprintf(__('Status code: %s', 'axiscomposer'), ac_clean($response['response']['code'])); } $posting['wp_remote_post']['success'] = false; } // WP Remote Get Check. $posting['wp_remote_get']['name'] = __('Remote Get', 'axiscomposer'); $posting['wp_remote_get']['help'] = ac_help_tip(__('AxisComposer plugins may use this method of communication when checking for plugin updates.', 'axiscomposer')); $response = wp_safe_remote_get('https://api.github.com/repos/axisthemes/axiscomposer/contributors');
/** * 'include_box' tpl func * * @param array $params * parameters array, including: * required parameters: * $params['name']: box name * control parameters: * $params['at'] : 'mod:user' means that the box is defined in user module; 'app:fpic' means that the box is defined in fpic app * $params['ctrl']: control parameters, for example: ctrl="hide:0,notpl:1", means show the box, and the box no need read smarty template file. * detail control parameter: * $pctrl['hide']: whether hide the box, default 0 * $pctrl['notpl']: whether no need read template file, default 0 * $pctrl['fpipe']: whether use FPipe render page html, default 0 * $pctrl['phase']: if $pctrl['fpipe'] is true, this parameter make effect, indicating the html render order. * $pctrl['id']: if $pctrl['fpipe'] is true, this parameter make effect, indicating box wrapper id. * callback function parameters: * ... * @param object $tpl * smarty object * * @param array $params_parsed * * @return string * generated string by box * */ public static function include_box($params, $tpl = NULL, $params_parsed = array()) { if (empty($params_parsed)) { //~ parse ctrl parameters $pctrl = array('hide' => 0, 'notpl' => 0, 'fpipe' => is_fpipe(), 'phase' => 0, 'id' => '', 'css' => '', 'js' => ''); if (isset($params['ctrl'])) { $params['ctrl'] = trim($params['ctrl'], '{} '); $arr1 = explode(',', $params['ctrl']); if (count($arr1)) { $chkctrl = array_keys($pctrl); foreach ($arr1 as &$it1) { $arr2 = explode(':', $it1); $arr2[0] = trim($arr2[0]); $arr2[1] = isset($arr2[1]) ? trim($arr2[1]) : ''; if (in_array($arr2[0], $chkctrl)) { $pctrl[$arr2[0]] = $arr2[1]; } } } unset($params['ctrl']); } //~ if hide, then return empty string if ($pctrl['hide']) { return ''; } //~ check boxname and box in where $boxname = $params['name']; $boxat = ''; $boxapp = ''; $arr1 = explode('@', $boxname); if (count($arr1) > 1) { //like name='abox@app:fpic' $boxname = trim($arr1[0]); $arr2 = explode(':', trim($arr1[1])); $boxat = trim($arr2[0]); $boxapp = isset($arr2[1]) ? trim($arr2[1]) : ''; if (!in_array($boxat, array('mod', 'app')) || '' == $boxapp) { $boxat = ''; $boxapp = ''; } } elseif (isset($params['at'])) { $at = trim($params['at']); if ('' != $at) { $arr2 = explode(':', $at); $boxat = trim($arr2[0]); $boxapp = isset($arr2[1]) ? trim($arr2[1]) : ''; if (!in_array($boxat, array('mod', 'app')) || '' == $boxapp) { $boxat = ''; $boxapp = ''; } } unset($params['at']); } unset($params['name']); $boxfunc = $boxname; //~ if use pipe stream method to render html, just store box info first if ($pctrl['fpipe']) { global $_BOXDATA; $_BOXDATA[] = array('boxname' => $boxname, 'boxfunc' => $boxfunc, 'boxat' => $boxat, 'boxapp' => $boxapp, 'params' => $params, 'notpl' => $pctrl['notpl'], 'phase' => $pctrl['phase'], 'id' => $pctrl['id'], 'css' => $pctrl['css'], 'js' => $pctrl['js']); return ''; //return directly, no do business logic } } else { $pctrl = array('notpl' => $params_parsed['notpl']); $boxfunc = $params_parsed['boxfunc']; $params = $params_parsed['params']; $boxat = $params_parsed['boxat']; $boxapp = $params_parsed['boxapp']; } //~ adjust box tpl file path $file = 'box/' . $boxname; if ($boxat == 'mod') { $file = 'file:' . SIMPHP_ROOT . 'modules/' . $boxapp . '/tpl/' . $boxname; } elseif ($boxat == 'app') { $file = 'file:' . SIMPHP_ROOT . 'apps/' . $boxapp . '/tpl/' . $boxname; } //~ if no corresponding box function, then return empty string $boxclass = 'Box'; if (!method_exists($boxclass, $boxfunc)) { return ''; } $func_ajax_exist = method_exists($boxclass, '_' . $boxfunc); //like Box::_aboxfunc(correspondig to Box::aboxfunc) $return = call_user_func_array(array($boxclass, $boxfunc), array_merge(array($params), array($tpl))); //append $tpl to last parameter $extra = ''; if (!$pctrl['notpl']) { if ($func_ajax_exist) { $tpl->assign('isajaxload', 1); } $return = $tpl->fetch($file . C('env.tplpostfix')); if ($func_ajax_exist) { $atpart = '' == $boxapp ? '' : "@{$boxat}:{$boxapp}"; $extra = '<script type="text/javascript">'; $extra .= 'F.' . $boxfunc . '={ajaxurl:"' . A('ajax/loadbox') . AC() . 'name=' . $boxfunc . $atpart . '¶m=' . implode(',', $params) . '"};'; $extra .= '</script>'; $return = preg_replace_callback('/<!--\\[ajaxload(\\s+[^\\[\\]]*)?\\]-->(.*)<!--\\[\\/ajaxload\\]-->/sU', function ($matches) { return str_replace($matches[2], '', $matches[0]); }, $return); } } return $extra . (!empty($return) ? $return : ''); }
/** * TinyMCE locales function. * @param array $locales TinyMCE locales. * @return array */ public function add_tinymce_locales($locales) { $locales['axiscomposer_shortcodes'] = AC()->plugin_path() . '/i18n/shortcodes.php'; return $locales; }
/** * Settings page. * * Handles the display of the main AxisComposer settings page in admin. */ public static function output() { global $current_section, $current_tab; $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; do_action('axiscomposer_settings_start'); wp_enqueue_script('axiscomposer-settings', AC()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array('jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'select2'), AC_VERSION, true); wp_localize_script('axiscomposer-settings', 'axiscomposer_settings_params', array('i18n_nav_warning' => __('The changes you made will be lost if you navigate away from this page.', 'axiscomposer'))); // Include settings pages self::get_settings_pages(); // Get current tab/section $current_tab = empty($_GET['tab']) ? 'general' : sanitize_title($_GET['tab']); $current_section = empty($_REQUEST['section']) ? '' : sanitize_title($_REQUEST['section']); // Save settings if data has been posted if (!empty($_POST)) { self::save(); } // Add any posted messages if (!empty($_GET['ac_error'])) { self::add_error(stripslashes($_GET['ac_error'])); } if (!empty($_GET['ac_message'])) { self::add_message(stripslashes($_GET['ac_message'])); } // Get tabs for the settings page $tabs = apply_filters('axiscomposer_settings_tabs_array', array()); include dirname(__FILE__) . '/views/html-admin-settings.php'; }
<?php $a = <<<B B; $a .= 'C'; if (isset($b['D'])) { if (E($b['D'])) { $c = 'G' . H($b['D']) . 'J'; } else { $c = 'K' . H($b['D']) . 'N' . H($b['P']) . 'Q' . H($b['S']) . 'T'; } $d = "U{$this->VW}" . H($b[Y]) . "Z{$cAA}"; $e = AB($d); if (AC()) { AD(AC()); } }
* @return string */ public function ajax_url() { return admin_url('admin-ajax.php', 'relative'); } /** * Get shortcodes class. * @return AC_Shortcodes */ public function shortcodes() { return AC_Shortcodes::instance(); } } } /** * Main instance of AxisComposer. * * Returns the main instance of AC to prevent the need to use globals. * * @since 1.0.0 * @return AxisComposer */ function AC() { return AxisComposer::instance(); } // Global for backwards compatibility. $GLOBALS['axiscomposer'] = AC();
/** * Update DB version to current. * @param string $version */ public static function update_db_version($version = null) { delete_option('axiscomposer_db_version'); add_option('axiscomposer_db_version', is_null($version) ? AC()->version : $version); }
/** * AxisComposer Core Supported Iconfonts. * @return array */ function ac_get_core_supported_iconfonts() { $core_iconfonts['entypo-fontello'] = array('default' => true, 'version' => '?v=3', 'charmap' => 'charmap.php', 'font_url' => AC()->plugin_url() . '/assets/fonts/entypo-fontello', 'font_dir' => AC()->plugin_path() . '/assets/fonts/entypo-fontello'); return apply_filters('axiscomposer_core_supported_iconfonts', $core_iconfonts); }
/** * Regular Expression callable for do_shortcode_builder() for calling shortcode hook. * @see get_shortcode_regex for details of the match array contents. * * @since 1.0.0 * @access private * @uses $shortcode_tags * * @param array $m Regular expression match array * @return mixed False on failure. */ function do_shortcode_tag_builder($m) { global $shortcode_tags; // allow [[foo]] syntax for escaping a tag if ($m[1] == '[' && $m[6] == ']') { return substr($m[0], 1, -1); } // Let's initialized values as an array $values = array(); // Check for enclosing tag or self closing $values['tag'] = $m[2]; $values['attr'] = shortcode_parse_atts(stripslashes($m[3])); $values['closing'] = strpos($m[0], '[/' . $m[2] . ']'); $values['content'] = $values['closing'] !== false ? $m[5] : null; if (isset($_POST['params']['extract'])) { // If we open a modal window check for the nested shortcodes if ($values['content']) { $values['content'] = do_shortcode_builder($values['content']); } $_POST['extracted_shortcode'][] = $values; return $m[0]; } if (in_array($values['tag'], ac_get_shortcode_data('name'))) { $_available_shortcodes = AC()->shortcodes->get_editor_element($values['content'], $values['attr']); return $_available_shortcodes[$values['tag']]; } else { return $m[0]; } }
/** * Test ac_get_core_supported_iconfonts() * * @since 1.0.0 */ public function test_ac_get_core_supported_iconfonts() { $expected_iconfonts['entypo-fontello'] = array('default' => true, 'version' => '?v=3', 'charmap' => 'charmap.php', 'font_url' => AC()->plugin_url() . '/assets/fonts/entypo-fontello', 'font_dir' => AC()->plugin_path() . '/assets/fonts/entypo-fontello'); $this->assertEquals($expected_iconfonts, ac_get_core_supported_iconfonts()); }
/** * Setup test * * @since 1.0.0 */ public function setUp() { parent::setUp(); $this->ac = AC(); }
<?php $a = array('B' => C::D('E', F::G, H), 'I' => isset($b['J']) ? K : L, 'M' => N::O('P', Q::R), 'S' => T(U::V('W', X::Y)), 'Z' => AA($c['AB']) ? AC(0, AD($d['AE'])) : $e['AF']);
/** * Change the admin footer text on AxisComposer admin pages. * @param string $footer_text * @return string */ public function admin_footer_text($footer_text) { if (!current_user_can('manage_axiscomposer') || !function_exists('ac_get_screen_ids')) { return; } $current_screen = get_current_screen(); $ac_pages = ac_get_screen_ids(); // Check to make sure we're on a AxisComposer admin page if (isset($current_screen->id) && apply_filters('axiscomposer_display_admin_footer_text', in_array($current_screen->id, $ac_pages))) { // Change the footer text if (!get_option('axiscomposer_admin_footer_text_rated')) { $footer_text = sprintf(__('If you like <strong>AxisComposer</strong> please leave us a %s★★★★★%s rating. A huge thanks in advance!', 'axiscomposer'), '<a href="https://wordpress.org/support/view/plugin-reviews/axiscomposer?filter=5#postform" target="_blank" class="ac-rating-link" data-rated="' . esc_attr__('Thanks :)', 'axiscomposer') . '">', '</a>'); ac_enqueue_js("\n\t\t\t\t\tjQuery( 'a.ac-rating-link' ).click( function() {\n\t\t\t\t\t\tjQuery.post( '" . AC()->ajax_url() . "', { action: 'axiscomposer_rated' } );\n\t\t\t\t\t\tjQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );\n\t\t\t\t\t});\n\t\t\t\t"); } else { $footer_text = __('Thank you for creating with AxisComposer.', 'axiscomposer'); } } return $footer_text; }
/** * Display shortcode links for an option panel. * @param string $type Options panel data type. */ protected static function display_panel_shortcodes($type = 'plugin') { $screen = get_current_screen(); foreach (AC()->shortcodes->get_shortcodes() as $load_shortcodes) { if (empty($load_shortcodes->shortcode['invisible'])) { if ($type === $load_shortcodes->shortcode['type']) { $title = $load_shortcodes->method_title; $tooltip = $load_shortcodes->method_description; $shortcode = $load_shortcodes->shortcode; $class_list = array(); // Shortcode class list. if (!empty($shortcode['class'])) { $class_list[] = $shortcode['class']; } if (!empty($shortcode['target'])) { $class_list[] = $shortcode['target']; } // Specific screen shortcode. if (isset($screen->id) && isset($shortcode['specific']['screen']) && !in_array($screen->id, $shortcode['specific']['screen'])) { $class_list[] = 'disabled-shortcode'; $tooltip = isset($shortcode['specific']['notice']) ? $shortcode['specific']['notice'] : __('Current screen doesn\'t support this shortcode element =/', 'axiscomposer'); } // Create a shortcode button link. echo '<a href="#' . strtolower($shortcode['name']) . '" class="insert-shortcode help_tip ' . esc_attr(implode(' ', $class_list)) . '" data-dragdrop-level="' . esc_attr($shortcode['drag-level']) . '" data-tip="' . ac_sanitize_tooltip($tooltip) . '"><i class="' . ac_format_icon($shortcode['icon']) . '"></i><span class="desc">' . wp_kses_post($title) . '</span></a>'; } } } }
/** * Loads shortcodes methods into memory for use within settings. */ public function settings_page_init() { AC()->shortcodes(); }
/** * Add notices + styles if needed. */ public static function add_notices() { $notices = self::get_notices(); if ($notices) { wp_enqueue_style('axiscomposer-activation', AC()->plugin_url() . '/assets/css/activation.css', array(), AC_VERSION); foreach ($notices as $notice) { if (!empty(self::$core_notices[$notice]) && apply_filters('axiscomposer_show_admin_notice', true, $notice)) { add_action('admin_notices', array(__CLASS__, self::$core_notices[$notice])); } else { add_action('admin_notices', array(__CLASS__, 'output_custom_notices')); } } } }