post expire after x days
You’re comparing strings. For dates this will only ever work out if you use a yyyymmdd format or similar.
You’re comparing strings. For dates this will only ever work out if you use a yyyymmdd format or similar.
Below code will work with WordPress default login/register screens: add_action( ‘wp’, ‘member_only_site’ ); function member_only_site( ) { if ( ! is_user_logged_in( ) ) { auth_redirect(); } }
Look at ‘save_post’ and Post Status Transitions. save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. The data for the post is stored in $_POST, $_GET or the global $post_data, depending on how the post was … Read more
In fact, most of plugins work exactly the way you want: You MUST upload them (i.e. install them) on network admin panel, but you can leave them deactivated. Then, you go to an individual subsite plugin page and activate only for said subsite.
You need to use action wp_enqueue_scripts except wp_head like: function inf_remove_junk() { if (!is_admin()) { wp_dequeue_style(‘js_composer_front’); wp_dequeue_style(‘js_composer_custom_css’); wp_dequeue_script(‘wpb_composer_front_js’); } } add_action( ‘wp_enqueue_scripts’, ‘inf_remove_junk’ ); But it remove the scripts from front end. I think on archive pages VC does not execute it’s shortcode. So you can check is_archive() condition instead of is_admin(). Or you can … Read more
With your CODE as is, where the log.txt file will be written depends on PWD (Present Working Directory value). It can be your web root, or any where else. However, since WordPress AJAX calls are made to wp-admin/admin-ajax.php file, PWD for AJAX is almost always the wp-admin/ directory. So if you use the file path … Read more
Why not multisite: Multisite installations are difficult to maintain compared to single site installations. Many useful plugins don’t work properly on multisite installations. There may be SEO concern for such short web sites with basically just one page (thank you page doesn’t count) that looks very similar from the names. Multisite won’t solve this probable … Read more
I have checked your code. You are using incorrect menu-slug in add_submenu_page. Because admin already has page query var which conflicts with your menu slug page=settings&submenu=page2. I have updated the code. add_menu_page( ‘Main Menu’, ‘Main Menu Titlw’, $min_access_cap, ‘main-main’, array($this, ‘main_menu’), $icon_url, 999 ); add_submenu_page( ‘main-menu’, sprintf( __( ‘%1$s ‹ %2$s’, ‘main-menu’ ), $title[‘page_title’], ‘Submenu’ … Read more
You need to access the class variable to remove a action which has been added within a class function remove_default_order_barcode(){ global $WooCommerce_Order_Barcodes ; remove_action( ‘woocommerce_order_details_after_order_table’, array( $WooCommerce_Order_Barcodes, ‘get_display_barcode’ ), 1, 1 ); } add_action(‘init’,’remove_default_order_barcode’); hope it will help you !
I found the solution for my problem. The object type for media is not media, it’s just attachment. So the following code works for me: <?php /** * Plugin Name: REST Response Modifier * Description: A simple plugin to modify the rest api * Author: TheBalco * Author URI: http://somepage.dev */ add_action(‘rest_api_init’, ‘tb_add_custom_rest_fields’); function tb_add_custom_rest_fields() … Read more