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

My Account Modifications

/* * * MY-ACCOUNT MODIFICATIONS * */ // Remove downloads from menu add_filter ( ‘woocommerce_account_menu_items’, ‘silva_remove_my_account_links’ ); function silva_remove_my_account_links( $menu_links ){ unset( $menu_links[‘downloads’] ); // Disable Downloads return $menu_links; }Continue reading

Clean Up HTML – Post Content Editor

// Clean up HTML from blog posts function add_custom_cleanup_checkbox() { add_meta_box( ‘custom_cleanup_id’, // ID of the meta box ‘Custom Cleanup’, // Title of the meta box ‘custom_cleanup_checkbox_callback’, // Callback function ‘post’, // Post type ‘side’, // Context ‘high’ // Priority…Continue reading

Registration Surcharges

/* * REGISTRATION SURCHARGES * * Add a custom surcharge to your cart / checkout * change the $percentage to set the surcharge to a value to suit * * Loop through the cart items by category * Add $1…Continue reading

Charitable Reporting: Adjusting Initial Filters

add_filter( ‘charitable_report_overview_args’, ‘example_charitable_report_overview_defaults’, 999 ); function example_charitable_report_overview_defaults( $defaults = array() ) { // Defaults array contains: // start_date, end_date, filter, campaign_id, category_id. // The $defaults array contains the default values for the report overview. // You can modify these as…Continue reading

Remove users from WP-JSON

add_filter(‘rest_endpoints’, function( $endpoints ) { if ( isset( $endpoints[‘/wp/v2/users’] ) ) { unset( $endpoints[‘/wp/v2/users’] ); } if ( isset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ) ) { unset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ); } return $endpoints; });Continue reading