//投稿一覧にスラッグ表示 function add_posts_columns_slug($columns) { $columns[‘slug’] = ‘スラッグ’; return $columns; } function add_posts_columns_slug_row($column_name, $post_id) { if( ‘slug’ == $column_name ) { $slug = get_post($post_id) -> post_name; echo $slug; } } add_filter( ‘manage_edit-post_sortable_columns’, ‘add_posts_columns_slug’ ); add_filter( ‘manage_posts_columns’, ‘add_posts_columns_slug’ ); add_action( ‘manage_posts_custom_column’, ‘add_posts_columns_slug_row’,…Continue reading
/** * Disable the email address suggestion. * * @link https://wpforms.com/developers/how-to-disable-the-email-suggestion-on-the-email-form-field/ * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ add_filter( ‘wpforms_mailcheck_enabled’, ‘__return_false’ );Continue reading
function wpb_hook_javascript() { if (is_single (‘5’)) { ?>Continue reading
use Automattic\WooCommerce\Client; $woocommerce = new Client( ‘https://store.groomingtoneats.com’, ‘ck_0f590d787c855fd402b73efd3080ca23775c8cd4’, ‘cs_9d6055ca2d77c1bbe72e4fca7fd7574dbd731512’, [ ‘wp_api’ => true, ‘version’ => ‘wc/v3’, ]) ;$FieldValue = get_field(‘product’,’option’); $WooProduct = “products/$FieldValue”; $ProductMeta = $woocommerce->get($WooProduct); $TheImage = $ProductMeta->images; $ProductName = $ProductMeta->name; $ProductPrice = $ProductMeta->price; $ProductImage = $TheImage[0]->src; ?>Continue reading
add_filter( ‘aioseo_schema_output’, ‘aioseo_schema_change_urls’ ); function aioseo_schema_change_urls( $graphs ) { if ( false === strpos( $_SERVER[‘REQUEST_URI’], ‘search-results/listing/’ ) ) { return $graphs; } $request_uri = explode( ‘?’, $_SERVER[‘REQUEST_URI’] ); $request_uri = explode( ‘#’, $request_uri[0] ); $url_parts = trim($request_uri[0], ‘/’); $url_parts =…Continue reading
add_filter( ‘the_content’, ‘add_image_dimensions’ ); function add_image_dimensions( $content ) { preg_match_all( ‘/]+>/i’, $content, $images); if (count($images) < 1) return $content; foreach ($images[0] as $image) { preg_match_all( '/(alt|title|src|width|class|id|height)=("[^"]*")/i', $image, $img ); if ( !in_array( 'src', $img[1] ) ) continue; if ( !in_array(…Continue reading
add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading
add_filter( ‘elementor/frontend/print_google_fonts’, ‘__return_false’ );Continue reading
add_filter( ‘elementor_pro/custom_fonts/font_display’, function( $current_value, $font_family, $data ) { return ‘swap’; }, 10, 3 );Continue reading