function register_review_list() { register_rest_route(‘review/v1’, ‘reviewList’, [ ‘methods’ => WP_REST_SERVER::READABLE, ‘callback’ => ‘review_list_results’ ]); } function review_list_results($data) { $results = []; // basic error handling if (false === isset($data[‘term’]) ) { return [ ‘error’ => ‘No soup for you…’ ]; }…Continue reading
/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading
add_filter( ‘tasty_recipes_quick_links’, function( $links ) { $links[] = ‘Rate this Recipe‘; return $links; } );Continue reading
function afwerx_redirect() { if (isset($_SERVER[‘HTTPS’]) && ($_SERVER[‘HTTPS’] == ‘on’ || $_SERVER[‘HTTPS’] == 1) || isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) { $protocol = ‘https://’; } else { $protocol = ‘http://’; } $currenturl = $protocol . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; $currenturl_relative = wp_make_link_relative($currenturl);…Continue reading
add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( is_search() && ‘product’ === get_query_var(‘post_type’) ) { $attributes[‘index’] = “noindex”; }; return $attributes; }Continue reading
/* Change WooCommerce Archive products number per page */ add_filter( ‘loop_shop_per_page’, ‘my_new_products_per_page’, 9999 ); function my_new_products_per_page( $pr_per_page ) { $pr_per_page = 16; return $pr_per_page; }Continue reading
function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘wpcode_snippet_add_slug_body_class’ );Continue reading