How to access specific product id on other pages/posts?

Thanks the Tony Djukic coment, here is a working code example: <?PHP $product_id = 92; /*hard code the product id */ $manufacture_url = get_field( “manufacture_url”, $product_id, true ); echo ‘some html’ + $manufacture_url + ‘some html’ ?> The product ID can be found in the product URL on editing mode. I used xyz PHP plugin … Read more

Force REST API Authentication for each request method

You can’t really apply authentication based directly on whether the request is GET or otherwise, but can forcefully apply authentication requirements globally in that manner, if you like. I’ve been quite verbose with the code to illustrate what’s happening: add_filter( ‘rest_authentication_errors’, function ( $error ) { /** * If it’s a WP_Error, leave it as … Read more

Display the list of user’s comments + the post title + date

add this snippet for according your needed: add_shortcode ( ‘show_recent_comments’, ‘show_recent_comments_handler’ ); function show_recent_comments_handler( $atts, $content = null ) { extract( shortcode_atts( array( “count” => 10, “pretty_permalink” => 0 ), $atts )); $output=””; // this holds the output if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $args = array( ‘user_id’ => $current_user->ID, ‘number’ => $count, … Read more