function eddccu_add_tools_tab( $tabs ) { $tabs[‘eddccu_customers’] = __( ‘Customers’, ‘edd-convert-customers-to-users’ ); return $tabs; } add_filter( ‘edd_tools_tabs’, ‘eddccu_add_tools_tab’ ); /** * Display the Customers tab content in Downloads > Tools */ function eddccu_display_tools_tab() { if ( !current_user_can( ‘manage_shop_settings’ ) ) {…Continue reading
add_filter( ‘use_widgets_block_editor’, ‘__return_false’ );Continue reading
function wpsnippets_allow_svg_files($mime_types) { // Return original value if user doesn’t have a required capability if (!current_user_can(‘manage_options’)) { return $mime_types; } $mime_types[‘svg’] = ‘image/svg+xml’; $mime_types[‘svgz’] = ‘image/svg+xml’; return $mime_types; } add_filter(‘upload_mimes’, ‘wpsnippets_allow_svg_files’);Continue reading
/** * Add the gateway to WC Available Gateways * * @since 1.0.0 * @param array $gateways all available WC gateways * @return array $gateways all WC gateways + Woo MPGS gateway */ function woo_mpgs_add_to_gateways( $gateways ) { $gateways[] =…Continue reading
function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading
function g9_user_role_order_icon($column_name, $post_id) { if ($column_name == ‘order_number’) { $order = wc_get_order($post_id); // Get user id from order $user_id = $order->get_user_id(); if ($user_id > 0) { $user_meta = get_userdata($user_id); $user_roles = $user_meta->roles; // Check if user role my-custom-user-role is in…Continue reading
// Main content area. add_action( ‘wpforms_entry_details_content’, static function ( $entry, $form_data, $single_entry ) { $hook_name = ‘wpforms_entry_details_content’; remove_action( $hook_name, [ $single_entry, ‘details_fields’ ], 10 ); remove_action( $hook_name, [ $single_entry, ‘details_notes’ ], 10 ); remove_action( $hook_name, [ $single_entry, ‘details_log’ ], 40…Continue reading
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
add_filter( ‘http_request_args’, ‘aioseo_filter_analyzer_timeout’, 1, 2 ); function aioseo_filter_analyzer_timeout( $args, $url ) { if ( ‘https://analyze.aioseo.com/v1/analyze/’ === $url ) { $args[‘timeout’] = 120; } return $args; }Continue reading