/** * Adds the plugin toplevel menu * * @return void */ public function add_toplevel_menu() { global $menu; // Default menu positioning $position = '100.1'; // If enabled, relocate the plugin menus higher if (apply_filters('easingslider_relocate_menus', __return_true())) { for ($position = '40.1'; $position <= '100.1'; $position += '0.1') { // Ensure there is a space before and after each position we are checking, leaving room for our separators. $before = $position - '0.1'; $after = $position + '0.1'; // Do the checks for each position. These need to be strings, hence the quotation marks. if (isset($menu["{$position}"])) { continue; } if (isset($menu["{$before}"])) { continue; } if (isset($menu["{$after}"])) { continue; } // If we've successfully gotten this far, break the loop. We've found the position we need. break; } } // Add toplevel menu add_menu_page(__('Sliders', 'easingslider'), __('Sliders', 'easingslider'), 'easingslider_edit_sliders', 'easingslider_edit_sliders', null, 'dashicons-images-alt', "{$position}"); // Do action allowing extension to add their own toplevel menus do_action('easingslider_add_toplevel_menu', $position); // Add the menu separators if menus have been relocated (they are by default). Quotations marks ensure these are strings. if (apply_filters('easingslider_relocate_menus', __return_true())) { $this->add_menu_separator("{$before}"); $this->add_menu_separator("{$after}"); } }
function enable_comment_for_case_cp($open, $post_id) { if ('cases' == get_post_type($post_id)) { $open = __return_true(); } return $open; }
/** * Handles making this version of Press This backward compatible with the previous/legacy version by supporting its query string params * * @since 4.2 * * @return array */ public function merge_or_fetch_data() { // Merge $_POST and $_GET, as appropriate ($_POST > $_GET), to remain backward compatible $data = array_merge_recursive($_POST, $_GET); // Get the legacy QS params, or equiv POST data $data['u'] = !empty($data['u']) && preg_match('/^https?:/', $data['u']) ? $data['u'] : ''; $data['s'] = !empty($data['s']) ? $data['s'] : ''; $data['t'] = !empty($data['t']) ? $data['t'] : ''; /** * press_this_media_discovery: Whether to enable or disable in-source media discovery. * * @since 4.2 * @see https://github.com/MichaelArestad/Press-This/issues/62 * * @param bool $enable Defaults to true * * @return bool */ if (apply_filters('press_this_media_discovery', __return_true())) { // If no _meta (a new thing) was passed via $_POST, fetch data from source as fallback, makes PT fully backward compatible if (empty($data['_meta']) && !empty($data['u'])) { $data = $this->source_data_fetch_fallback($data['u'], $data); } } else { if (!empty($data['_img'])) { $data['_img'] = array(); } if (!empty($data['_embed'])) { $data['_embed'] = array(); } if (!empty($data['_meta'])) { $data['_meta'] = array(); } } /** * press_this_data: Data array used by PT to provide meta data gathered from the source. * * @since 4.2 * * @param array $data Data array * * @return array */ return apply_filters('press_this_data', $data); }
/** * Constructor * * @since 2.0 */ private function __construct() { global $wp_version; /** Load plugin textdomain for language capabilities */ load_plugin_textdomain('easingsliderlite', false, dirname(plugin_basename(self::get_file())) . '/languages'); /** Flag the new admin area if appropriate */ $this->is_updated_admin = version_compare($wp_version, '3.8', '>=') ? true : false; /** Activation and deactivation hooks. Static methods are used to avoid activation/uninstallation scoping errors. */ if (is_multisite()) { register_activation_hook(__FILE__, array(__CLASS__, 'do_network_activation')); register_uninstall_hook(__FILE__, array(__CLASS__, 'do_network_uninstall')); } else { register_activation_hook(__FILE__, array(__CLASS__, 'do_activation')); register_uninstall_hook(__FILE__, array(__CLASS__, 'do_uninstall')); } /** Legacy functionality */ if (apply_filters('easingsliderlite_legacy_functionality', __return_true())) { ESL_Legacy::init($this); } /** Plugin shortcodes */ add_shortcode('easingsliderlite', array($this, 'do_shortcode')); /** Plugin actions */ add_action('init', array($this, 'register_all_styles')); add_action('init', array($this, 'register_all_scripts')); add_action('admin_menu', array($this, 'add_menus')); add_action('admin_menu', array($this, 'do_actions')); add_action('admin_body_class', array($this, 'admin_body_classes')); add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles')); add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts')); add_action('media_buttons', array($this, 'add_media_button'), 11); add_action('print_media_templates', array($this, 'print_backbone_templates')); add_action('wp_before_admin_bar_render', array($this, 'add_admin_bar_links')); /** Do plugin upgrades */ add_action('admin_init', array('ESL_Upgrade', 'do_upgrades')); /** Register our custom widget */ add_action('widgets_init', create_function('', 'register_widget( "ESL_Widget" );')); /** Some hooks for our own custom actions */ add_action('easingsliderlite_edit_slideshow_actions', array($this, 'do_slideshow_actions')); add_action('easingsliderlite_customizer_actions', array($this, 'do_customizer_actions')); add_action('easingsliderlite_edit_settings_actions', array($this, 'do_settings_actions')); /** Get plugin settings */ $settings = get_option('easingsliderlite_settings'); /** Load slideshow scripts & styles in the header if set to do so */ if (isset($settings['load_scripts']) && $settings['load_scripts'] == 'header') { add_action('wp_enqueue_scripts', array('ESL_Slideshow', 'enqueue_scripts')); } if (isset($settings['load_styles']) && $settings['load_styles'] == 'header') { add_action('wp_enqueue_scripts', array('ESL_Slideshow', 'enqueue_styles')); add_action('wp_head', array('ESL_Slideshow', 'print_custom_styles')); } /** Initialization hook for adding external functionality */ do_action_ref_array('easingsliderlite', array($this)); }
<div class="easingsliderlite-icon inactive"></div> <?php } ?> </div> <?php } else { do_action('easingsliderlite_pagination', $s, $c); } ?> <?php /** Edit slideshow link, don't remove this! Won't show if user isn't logged in or doesn't have permission to edit slideshows */ ?> <?php if (current_user_can('easingsliderlite_edit_slideshow') && apply_filters('easingsliderlite_edit_slideshow_icon', __return_true())) { ?> <a href="<?php echo admin_url("admin.php?page=easingsliderlite_edit_slideshow"); ?> " style="position: absolute; top: -15px; left: -15px; z-index: 50;"> <img src="<?php echo plugins_url(dirname(plugin_basename(EasingSliderLite::get_file()))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'edit_icon.png'; ?> " style="box-shadow: none; border-radius: none;" /> </a> <?php } ?> </div>
if ($mode != 'overview' && epl_sc_is_enabled()) { ?> <a href ="#" class="delete_cart_item" id="<?php echo $event_id; ?> ">Delete</a> <?php } ?> </div> <div class='epl_event_title'><?php echo $event['title']; ?> </div> <?php if (!EPL_IS_ADMIN && $max_regis > 0 && apply_filters('epl_cart__show_max_regis_message', __return_true())) { ?> <div class="epl_info"> <?php epl_e(sprintf('Please note that you can register a maximum of %d people for this event.', $max_regis)); ?> </div> <?php } ?> <div class="epl_event_selections"> <?php if (epl_get_element('_epl_event_detail_cart_display', $event_details, 10) == 10 && $mode != 'overview') { ?>
</div> <div id="major-publishing-actions"> <div id="publishing-action"> <span class="spinner"></span> <input type="submit" name="save" class="button button-primary button-large" id="save" accesskey="p" disabled="disabled" value="<?php _e('Update', 'easingslider'); ?> "> </div> <div class="clear"></div> </div> </div> <!-- Support Easing Slider --> <?php if (apply_filters('easingslider_show_advert', __return_true())) { ?> <?php /** * Create the Tweet URL */ $tweet_url = add_query_arg(array('text' => __('Check out Easing Slider, an easy to use free slider plugin for WordPress.', 'easingslider'), 'url' => 'http://easingslider.com/', 'via' => 'EasingSlider', 'hashtags' => 'wordpress'), 'https://twitter.com/intent/tweet'); ?> <div class="widgets-holder-wrap fixed"> <a href="http://easingslider.com/addons/pro-bundle" target="_blank"> <img src="<?php echo plugin_dir_url(Easing_Slider::$file) . 'images/pro-bundle.png'; ?> " alt="\"Pro\" add-on bundle" style="display: block; width: 100%;" /> </a>
/** * Alias of __return_true */ function shoestrap_return_true() { _shoestrap_deprecated_function(__FUNCTION__, '3.2', '__return_true()'); return __return_true(); }
/** * Alias of __return_true */ function stachestack_return_true() { _stachestack_deprecated_function(__FUNCTION__, '3.2', '__return_true()'); return __return_true(); }