Type: php
Tyler Hall Tech Custom Snippets (copy)
// Custom PHP Code by Tyler (TITLE) function page_title_sc( ){ return get_the_title(); } add_shortcode( ‘page_title’, ‘page_title_sc’ ); // Enable Shortcode Execution in Text Widgets add_filter( ‘widget_text’, ‘do_shortcode’ ); // Disable Gutenberg Editor (use Classic Editor) add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’,…Continue reading
Change Admin Panel Footer Text (copy)
add_filter( ‘admin_footer_text’, function ( $footer_text ) { // Edit the line below to customize the footer text. $footer_text = ‘Powered by WordPress | WordPress Tutorials: WPBeginner‘; return $footer_text; } );Continue reading
Duplicate Post/Page Link
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
Disable Gutenberg Code Editing for Non-Admin Users
add_filter( ‘block_editor_settings_all’, function ( $settings ) { $settings[‘codeEditingEnabled’] = current_user_can( ‘manage_options’ ); return $settings; } );Continue reading
Waste Licence
Tyler Hall Tech Custom Snippets
// Custom PHP Code by Tyler (TITLE) function page_title_sc( ){ return get_the_title(); } add_shortcode( ‘page_title’, ‘page_title_sc’ ); // Enable Shortcode Execution in Text Widgets add_filter( ‘widget_text’, ‘do_shortcode’ ); // Disable Gutenberg Editor (use Classic Editor) add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’,…Continue reading
WooCommerce number of archive products per page
/* 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
Remove Login Shake Animation
add_action( ‘login_footer’, function () { remove_action( ‘login_footer’, ‘wp_shake_js’, 12 ); } );Continue reading
Disable Comment Form Website URL
add_filter( ‘comment_form_default_fields’, function ($fields) { if ( isset( $fields[‘url’] ) ) { unset( $fields[‘url’] ); } if ( isset( $fields[‘cookies’] ) ) { // Remove the website mention from the cookies checkbox label. $fields[‘cookies’] = str_replace(‘name, email, and website’, ‘name…Continue reading