What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-06 08:45:02
Create a custom top-level menu page Wordpress
add_action( 'admin_menu', 'misha_menu_page' ); function misha_menu_page() { add_menu_page( 'My Page Title', // page <title>Title</title> 'My Page', // menu link text 'manage_options', // capability to access the page 'mi... Add solution -
PHP 2022-02-03 07:40:43
remove gutenberg styles
// Don't load Gutenberg-related stylesheets. add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 ); function remove_block_css() { wp_dequeue_style( 'wp-block-library' ); // WordPress core wp_dequeue_style( 'wp-block-library-theme' ); // WordPress co... Add solution -
PHP 2022-02-02 21:46:25
wordpress show notice only on plugin page
function general_admin_notice(){ global $pagenow; if ( $pagenow == 'options-general.php' ) { echo '<div class="notice notice-warning is-dismissib... Add solution -
Other 2022-02-02 21:41:55
short code of button in visual composer
/** * Add the button */ function my_add_button( $editor_id ) { // Avoid getting added double where // it's supposed to be. if ( $editor_id == 'content' || $editor_id == 'themeblvd_editor' ) { return; } // Output button echo '<a href="#... Add solution -
Other 2022-02-02 05:07:30
woocommerce apply coupon with add to cart
function wc_ninja_apply_coupon( $coupon_code ) { if ( 'test_code' === $coupon_code ) { $product_id = 99; WC()->cart->add_to_cart( $product_id ); } } add_action( 'woocommerce_applied_coupon', 'wc_ninja_apply_coupon' ); Add solution -
PHP 2022-02-01 02:20:23
Woocommerce Display Custom Field value on the Thank You page [Custom Field Display 2]
/** * Display field value on the Thank You page.. * * PHP Custom Feild Value * * */ add_action( 'woocommerce_thankyou', 'misha_view_order_and_thankyou_page', 20 ); add_action( 'woocommerce_view_order', 'misha_view_order_and_thankyou_page', 20 ); ... Add solution -
Other 2022-02-01 00:51:25
disable oceanwp lightbox
/** * Disable the Lightbox scripts */ function my_enqueue_scripts() { // Unregister JS files wp_deregister_script( 'magnific-popup' ); wp_deregister_script( 'oceanwp-lightbox' ); // Unregister CSS file wp_deregister_style( 'magnific-popup' ); } ... Add solution -
PHP 2022-01-31 09:05:30
add_meta_box
/** * Calls the class on the post edit screen. */ function call_someClass() { new someClass(); } if ( is_admin() ) { add_action( 'load-post.php', 'call_someClass' )... Add solution
Best helpers
Ranking is empty