Grab meta data before post is saved
Grab meta data before post is saved
Grab meta data before post is saved
Actions (and filters) can be removed only after they had been set, therefor you will have to figure out when in the execution path the woocommerce_template_single_excerpt is being added, and remove it only after that.
You don’t really need to add this parameter, you can use global $post; function bp_add_visibility_to_activity( $content, $user_id, $activity_id ) { global $post; $post_id = $post->ID; // do stuff } add_action( ‘bp_activity_posted_update’, ‘bp_add_visibility_to_activity’, 10, 3 ); Note that $post->ID will return null if your are not in a post or page, so you maybe need to … Read more
After some more research I found a solution, turned out that I had to use admin_init.. function pg_save_custom_site_options(){ global $pagenow; if( ‘site-info.php’ == $pagenow && isset($_REQUEST[‘action’]) && ‘update-site’ == $_REQUEST[‘action’] ) { if ( isset( $_POST[‘blog’][‘custom_limit_amount’] ) ) { $new_field_value = intval( $_POST[‘blog’][‘custom_limit_amount’] ); if( is_int($new_field_value) ){ update_blog_option( $_POST[‘id’], ‘custom_limit_amount’, $new_field_value ); } } } … Read more
If you mean menu links then just do it via WordPress admin by going to Appearance > Menus. Depending how your theme is setup, the menu options available to you and those that you can create will be different.
Hooks with same priority number. Can one stack items returned in divs, position: absolute each with their own z-index?
Just call woocommerce proceed-to-checkout-button template in woocommerce_before_cart action hook as follows- add_action(‘woocommerce_before_cart’, ‘add_wc_button_proceed_to_checkout’); function add_wc_button_proceed_to_checkout(){ echo ‘<div class=”wc-proceed-to-checkout”>’; wc_get_template( ‘cart/proceed-to-checkout-button.php’ ); echo ‘</div>’; }
Create woocommerce order on new user registration
woocommerce_add_to_cart_validation passes the product id as the second argument to the callback function, so you can access it like this: function custom_fields_validation( $passed_validation, $product_id ) { if( isRecurring( $product_id ) ) { if ( empty( $_POST[‘inputday’]) ){ wc_add_notice( __( ‘Please select field 1;’, ‘woocommerce’ ), ‘error’ ); return false; } if ( empty( $_POST[‘inputtime’] )){ … Read more
You can pass arguments to pass meta_query to your wp_get_recent_posts() function. wp_get_recent_posts() makes call for get_posts(), so you can make use of all the arguments get_posts() or WP_Query uses. As per your need. $args= array( ‘meta_query’ => array(array(‘key’ => ‘_thumbnail_id’)) ); $recent_posts = wp_get_recent_posts($args); Along with other arguments you want to pass to your function. … Read more