Reusable Blocks accessible in backend

/** * Reusable Blocks accessible in backend * */ function be_reusable_blocks_admin_menu() { add_menu_page( ‘Reusable Blocks’, ‘Reusable Blocks’, ‘edit_posts’, ‘edit.php?post_type=wp_block’, ”, ‘dashicons-editor-table’, 22 ); } add_action( ‘admin_menu’, ‘be_reusable_blocks_admin_menu’ );Continue reading

Populate ACF Field with Post Types

function acf_load_post_types_populate_field( $field ) { // reset choices $field[‘choices’] = array(); // Get post types $args = array( ‘public’ => true, ); $post_types = get_post_types( $args, ‘objects’ ); unset( $post_types[‘attachment’] ); foreach ( $post_types as $post_type ) { $value =…Continue reading

Display the Last Updated Date (copy)

$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading

Hide Shipping Methods

/** * Hide shipping rates when free shipping is available. * Updated to support WooCommerce 2.6 Shipping Zones. * * @param array $rates Array of rates found for the package. * @return array */ function my_hide_shipping_when_free_is_available( $rates ) { $free…Continue reading

Edit Lost Password Text

function change_lost_your_password ($text) { if ($text == ‘Lost your password?’){ $text = ‘Reset/Forgot Password?’; } return $text; } add_filter( ‘gettext’, ‘change_lost_your_password’ );Continue reading

WP GraphQL取得数変更

add_filter( ‘graphql_connection_max_query_amount’, function ( int $max_amount, $source, array $args, $context, $info ) { // Bail if the fieldName isn’t avail if ( empty( $info->fieldName ) ) { return $max_amount; } // Bail if we’re not dealing with our target fieldName…Continue reading

Untitled Snippet

$_SESSION[‘PFC_loggedin’] = true; //2023-4-30 KIRK SCHMITT TO USE STANDARD THEME TO START INDEPENDENT PHP PROCESS //INSERT [PFC_shortcode1] ON PAGE //FROM https://stackoverflow.com/questions/18896146/insert-php-code-in-wordpress-page-and-post function PFC_function_1() { $output = “”; if($_SESSION[‘PFC_loggedin’]) { $output .= ‘LOGOUT‘; $output .= ‘Display Cylinder Data‘; $output .= ‘Enter…Continue reading

Allow SVG Files Upload

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Disable zoom on product page

function remove_image_zoom_support_webtalkhub() { remove_theme_support( ‘wc-product-gallery-zoom’ ); } add_action( ‘wp’, ‘remove_image_zoom_support_webtalkhub’, 100 );Continue reading