本文整理汇总了PHP中remove_action函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_action函数的具体用法?PHP remove_action怎么用?PHP remove_action使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_action函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parallax_home_genesis_meta
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function parallax_home_genesis_meta()
{
if (is_active_sidebar('home-section-1') || is_active_sidebar('home-section-2') || is_active_sidebar('home-section-3') || is_active_sidebar('home-section-4') || is_active_sidebar('home-section-5')) {
//* Enqueue parallax script
add_action('wp_enqueue_scripts', 'parallax_enqueue_parallax_script');
function parallax_enqueue_parallax_script()
{
if (!wp_is_mobile()) {
wp_enqueue_script('parallax-script', get_bloginfo('stylesheet_directory') . '/js/parallax.js', array('jquery'), '1.0.0');
}
}
//* Add parallax-home body class
add_filter('body_class', 'parallax_body_class');
function parallax_body_class($classes)
{
$classes[] = 'parallax-home';
return $classes;
}
//* Force full width content layout
add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
//* Remove primary navigation
remove_action('genesis_before_content_sidebar_wrap', 'genesis_do_nav');
//* Remove breadcrumbs
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
//* Remove the default Genesis loop
remove_action('genesis_loop', 'genesis_do_loop');
//* Add homepage widgets
add_action('genesis_loop', 'parallax_homepage_widgets');
}
}
示例2: __construct
function __construct()
{
// Do not automatically check translations updates after updating plugins/themes.
add_action('upgrader_process_complete', function () {
remove_action('upgrader_process_complete', array('Language_Pack_Upgrader', 'async_upgrade'), 20);
}, 1);
}
示例3: child_manage_woocommerce_styles
function child_manage_woocommerce_styles()
{
//remove generator meta tag
remove_action('wp_head', array($GLOBALS['woocommerce'], 'generator'));
//first check that woo exists to prevent fatal errors
if (function_exists('is_woocommerce')) {
//dequeue scripts and styles
if (!is_woocommerce() && !is_cart() && !is_checkout()) {
wp_dequeue_style('woocommerce_frontend_styles');
wp_dequeue_style('woocommerce_fancybox_styles');
wp_dequeue_style('woocommerce_chosen_styles');
wp_dequeue_style('woocommerce_prettyPhoto_css');
wp_dequeue_script('wc_price_slider');
wp_dequeue_script('wc-single-product');
wp_dequeue_script('wc-add-to-cart');
wp_dequeue_script('wc-cart-fragments');
wp_dequeue_script('wc-checkout');
wp_dequeue_script('wc-add-to-cart-variation');
wp_dequeue_script('wc-single-product');
wp_dequeue_script('wc-cart');
wp_dequeue_script('wc-chosen');
wp_dequeue_script('woocommerce');
wp_dequeue_script('prettyPhoto');
wp_dequeue_script('prettyPhoto-init');
wp_dequeue_script('jquery-blockui');
wp_dequeue_script('jquery-placeholder');
wp_dequeue_script('fancybox');
wp_dequeue_script('jqueryui');
}
}
}
示例4: __construct
function __construct()
{
global $bp;
// Ensure that we have access to some utility functions. Must use require_once()
// because BP Core is loaded during incremental upgrades
require_once BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php';
// Get current DB version
$this->database_version = !empty($bp->database_version) ? (int) $bp->database_version : 0;
if (!empty($bp->is_network_activate)) {
$this->is_network_activate = $bp->is_network_activate;
} elseif (!$this->current_step()) {
setcookie('bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH);
$_COOKIE['bp-wizard-step'] = 0;
}
$this->new_version = constant('BP_DB_VERSION');
$this->setup_type = !empty($bp->maintenance_mode) ? $bp->maintenance_mode : '';
$this->current_step = $this->current_step();
// Remove the admin menu while we update/install
remove_action(bp_core_admin_hook(), 'bp_core_add_admin_menu', 9);
// Call the save method that will save data and modify $current_step
if (isset($_POST['save'])) {
$this->save($_POST['save']);
}
// Build the steps needed for update or new installations
$this->steps = $this->add_steps();
}
示例5: gc_enterprise_bp_head
function gc_enterprise_bp_head()
{
remove_action('genesis_after_footer', 'bp_core_admin_bar', 88);
if (gconnect_have_adminbar() && (!is_home() || gconnect_get_option('adminbar'))) {
add_action('genesis_after_footer', 'gc_enterprise_adminbar', 88);
}
}
示例6: my_login_head
function my_login_head()
{
$options = get_option('blue_default_theme');
if ($options == "DarkLight") {
remove_action('login_head', 'wp_shake_js', 12);
}
}
示例7: __construct
/**
* Class constructor.
*/
public function __construct()
{
$this->options = WPSEO_Options::get_all();
global $fb_ver;
if (isset($fb_ver) || class_exists('Facebook_Loader')) {
add_filter('fb_meta_tags', array($this, 'facebook_filter'), 10, 1);
} else {
add_filter('language_attributes', array($this, 'add_opengraph_namespace'));
add_action('wpseo_opengraph', array($this, 'locale'), 1);
add_action('wpseo_opengraph', array($this, 'type'), 5);
add_action('wpseo_opengraph', array($this, 'og_title'), 10);
add_action('wpseo_opengraph', array($this, 'site_owner'), 20);
add_action('wpseo_opengraph', array($this, 'description'), 11);
add_action('wpseo_opengraph', array($this, 'url'), 12);
add_action('wpseo_opengraph', array($this, 'site_name'), 13);
add_action('wpseo_opengraph', array($this, 'website_facebook'), 14);
if (is_singular() && !is_front_page()) {
add_action('wpseo_opengraph', array($this, 'article_author_facebook'), 15);
add_action('wpseo_opengraph', array($this, 'tags'), 16);
add_action('wpseo_opengraph', array($this, 'category'), 17);
add_action('wpseo_opengraph', array($this, 'publish_date'), 19);
}
add_action('wpseo_opengraph', array($this, 'image'), 30);
}
remove_action('wp_head', 'jetpack_og_tags');
add_action('wpseo_head', array($this, 'opengraph'), 30);
}
示例8: __construct
function __construct()
{
LazyestGallery::__construct();
$this->slideshows = $this->dirshows = $this->thumbshows = 0;
$this->slideshow = $this->comment = '';
// actions
add_action('wp_head', array(&$this, 'css_rules'), 1);
add_action('wp_head', array(&$this, 'styles'), 2);
add_action('wp_head', array(&$this, 'scripts'), 1);
if ('TRUE' == $this->get_option('rel_canonical')) {
remove_action('wp_head', 'rel_canonical');
add_action('wp_head', array(&$this, 'rel_canonical'));
}
$structure = get_option('permalink_structure');
if (0 < strlen($structure) && 0 == strpos($structure, 'index.php') && 'TRUE' == $this->get_option('use_permalinks')) {
add_action('generate_rewrite_rules', array(&$this, 'rewrite_rules'));
add_action('init', array(&$this, 'flush_rules'), 100);
}
add_action('admin_bar_menu', array(&$this, 'admin_bar_menu'), 100);
add_action('after_setup_theme', array(&$this, 'setup_theme'));
// filters
add_filter('query_vars', array(&$this, 'query_vars'));
// shortcodes
add_shortcode('lg_folder', array(&$this, 'folder_code'));
add_shortcode('lg_gallery', array(&$this, 'gallery_code'));
add_shortcode('lg_image', array(&$this, 'image_code'));
add_shortcode('lg_slideshow', array(&$this, 'slideshow_code'));
}
示例9: ohs_theme_setup
/**
* Theme Supports
*/
function ohs_theme_setup()
{
add_theme_support('post-thumbnails');
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
add_theme_support('title-tag');
add_theme_support('automatic-feed-links');
add_theme_support('menus');
register_nav_menus(array('main-menu' => __('Main Menu', 'ohs-theme')));
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 1);
add_action('wp_footer', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_head_scripts', 1);
wp_register_script('jqueryCDN', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', null);
wp_enqueue_script('jqueryCDN');
wp_register_script('npo', get_bloginfo('template_url') . '/js/lib/npo.min.js', null);
wp_register_script('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', null);
wp_register_script('handlebars', get_bloginfo('template_url') . '/js/lib/handlebars.runtime.min.js', null);
wp_register_script('masonry', get_bloginfo('template_url') . '/js/lib/jquery.masonry.min.js', null);
wp_register_script('imagesLoaded', get_bloginfo('template_url') . '/js/lib/imagesloaded.pkgd.min.js', null);
wp_register_script('ohsTemplates', get_bloginfo('template_url') . '/js/templates.min.js', '0.1.1');
wp_register_script('renderTemplates', get_bloginfo('template_url') . '/js/dev/jquery.renderTemplate.js', '0.1');
wp_register_script('ohsMain', get_bloginfo('template_url') . '/js/dev/main.js', '0.1');
wp_register_script('ohsMedia', get_bloginfo('template_url') . '/js/dev/media.js', '0.1');
wp_enqueue_script('npo', false, array(), false, true);
wp_enqueue_script('bootstrap', false, array(), false, true);
wp_enqueue_script('handlebars', false, array(), false, true);
wp_enqueue_script('masonry', false, array(), false, true);
wp_enqueue_script('imagesLoaded', false, array(), false, true);
wp_enqueue_script('ohsTemplates', false, array(), false, true);
wp_enqueue_script('renderTemplates', false, array(), false, true);
wp_enqueue_script('ohsMain', false, array(), false, true);
wp_enqueue_script('ohsMedia', false, array(), false, true);
}
示例10: sydney_woo_actions
/**
* Add/remove actions
*/
function sydney_woo_actions()
{
remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'sydney_wc_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'sydney_wc_wrapper_end', 10);
}
示例11: skeleton_remove_recent_comments_style
function skeleton_remove_recent_comments_style()
{
global $wp_widget_factory;
if (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) {
remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style'));
}
}
示例12: events_blog
function events_blog()
{
// Allow to pubblish posts with future date
function pubblish_posts_in_the_future($data)
{
if ($data['post_status'] == 'future' && $data['post_type'] == 'post') {
$data['post_status'] = 'publish';
}
return $data;
}
remove_action('future_post', '_future_post_hook');
add_filter('wp_insert_post_data', 'pubblish_posts_in_the_future');
// Use date to find PREVIOUS MONTH and create link to it
function get_previous($current)
{
$date = date("Y-m-d", strtotime($current['year'] . '-' . $current['month'] . '-01'));
$previous = array("month" => date("m", strtotime(date("d-m-Y", strtotime($date)) . " -1 month")), "year" => date("Y", strtotime(date("d-m-Y", strtotime($date)) . " -1 month")));
return $previous;
}
// Use date to find NEXT MONTH and create link to it
function get_next($current)
{
$date = date("Y-m-d", strtotime($current['year'] . '-' . $current['month'] . '-01'));
$next = array("month" => date("m", strtotime(date("d-m-Y", strtotime($date)) . " +1 month")), "year" => date("Y", strtotime(date("d-m-Y", strtotime($date)) . " +1 month")));
return $next;
}
// Get the month name from number
function month_num_to_name($monthnum)
{
$monthName = date("F", mktime(0, 0, 0, intval($monthnum), 10));
return $monthName;
}
}
示例13: sv_wc_memberships_remove_processing_access
/**
* Removes membership access for processing orders
* so access is only granted at when orders are complete
*/
function sv_wc_memberships_remove_processing_access()
{
// make sure Memberships is active first
if (function_exists('wc_memberships')) {
remove_action('woocommerce_order_status_processing', array(wc_memberships(), 'grant_membership_access'), 11);
}
}
示例14: acfmod_simple_content_save_post
function acfmod_simple_content_save_post($post_id)
{
// bail early if no ACF data
if (empty($_POST['acf'])) {
return;
}
// array of field values
$fields = $_POST['acf'];
if (!isset($fields['acf_modules_field']) && is_array($fields['acf_modules_field'])) {
return;
}
// This may change in the future... yikes...
$delete_content_key = 'field_55686c1d9d812';
// assume we aren't deleting content
$do_delete_content = false;
// get modules values
foreach ($fields['acf_modules_field'] as $module) {
if (isset($module[$delete_content_key])) {
if ($module[$delete_content_key]) {
$do_delete_content = true;
}
}
}
// don't store the values for delete and load content fields
# not sure how to do that just yet
// bail early if we're not deleting the content
if (!$do_delete_content) {
return;
}
// clear the post content
remove_action('acf/save_post', 'acfmod_simple_content_save_post', 20);
$delete_content = array('ID' => $post_id, 'post_content' => '');
wp_update_post($delete_content);
add_action('acf/save_post', 'acfmod_simple_content_save_post', 20);
}
示例15: bil_head_cleanup
function bil_head_cleanup()
{
remove_action('wp_head', 'feed_links_extra');
// Display the links to the extra feeds such as category feeds
remove_action('wp_head', 'feed_links');
// Display the links to the general feeds: Post and Comment Feed
remove_action('wp_head', 'rsd_link');
// Display the link to the Really Simple Discovery service endpoint, EditURI link
remove_action('wp_head', 'wlwmanifest_link');
// Display the link to the Windows Live Writer manifest file.
remove_action('wp_head', 'index_rel_link');
// index link
remove_action('wp_head', 'parent_post_rel_link');
// prev link
remove_action('wp_head', 'start_post_rel_link');
// start link
remove_action('wp_head', 'adjacent_posts_rel_link');
// Display relational links for the posts adjacent to the current post.
remove_action('wp_head', 'wp_generator');
// Display the XHTML generator that is generated on the wp_head hook, WP version
// remove WP version from css
add_filter('style_loader_src', 'bones_remove_wp_ver_css_js', 9999);
// remove Wp version from scripts
add_filter('script_loader_src', 'bones_remove_wp_ver_css_js', 9999);
}