function auto_vote_5_stars_on_publish($ID, $post) { if ($post->post_status === ‘publish’) { if (function_exists(‘kk_star_ratings_insert’)) { kk_star_ratings_insert(“5”, $ID); } } } add_action(‘publish_post’, ‘auto_vote_5_stars_on_publish’, 10, 2);Continue reading
/** * Adding custom fonts to Generate Press * https://docs.generatepress.com/article/adding-local-fonts/ */ // allows the following to be uploaded add_filter( ‘upload_mimes’, function( $mimes ) { $mimes[‘woff’] = ‘application/x-font-woff’; $mimes[‘woff2’] = ‘application/x-font-woff2’; $mimes[‘ttf’] = ‘application/x-font-ttf’; $mimes[‘svg’] = ‘image/svg+xml’; $mimes[‘eot’] = ‘application/vnd.ms-fontobject’; return…Continue reading
/* Remove Post Title from Yoast Breadcrumb */ add_filter(‘wpseo_breadcrumb_single_link’, ‘remove_breadcrumb_title’ ); function remove_breadcrumb_title( $link_output) { if(strpos( $link_output, ‘breadcrumb_last’ ) !== false ) { $link_output = ”; } return $link_output; }Continue reading
// Estimated reading time function readTime ( $content = ”, $words_per_minute = 250, $with_gutenberg = false ) { // In case if content is build with gutenberg parse blocks if ( $with_gutenberg ) { $blocks = parse_blocks( $content ); $contentHtml…Continue reading
add_filter( ‘wcv_product_ships_from’, ‘ships_from_address’ ); function ships_from_address( $field ){ global $post, $product; $shipping_disabled = wc_string_to_bool( get_option( ‘wcvendors_shipping_management_cap’, ‘no’ ) ); $post = get_post( $product->get_id() ); if ( $product->needs_shipping() && ! $shipping_disabled && WCV_Vendors::is_vendor( $post->post_author ) ) { $vendor_id = WCV_Vendors::get_vendor_from_product( $product->get_id()…Continue reading
add_filter( ‘wcv_export_orders_use_shipping_address’, ‘wcv_order_export_use_shipping_address’ ); function wcv_order_export_use_shipping_address( ){ return false;Continue reading
add_filter( ‘wcv_dashboard_pages_nav’, ‘change_nav_order’); function change_nav_order( $pages ){ $new_nav_order = array(); $new_nav_order[‘dashboard_home’] = $pages[‘dashboard_home’]; $new_nav_order[‘order’] = $pages[‘order’]; $new_nav_order[‘product’] = $pages[‘product’]; $new_nav_order[‘rating’] = $pages[‘rating’]; $new_nav_order[‘shop_coupon’] = $pages[‘shop_coupon’]; $new_nav_order[‘settings’] = $pages[‘settings’]; $new_nav_order[‘view_store’] = $pages[‘view_store’]; return $new_nav_order;Continue reading
add_action( ‘admin_head’, function() { ?>Continue reading