// Add a custom column in the Media Library list view function custom_media_columns($columns) { // Check if the current user is an administrator if (current_user_can(‘manage_options’)) { $columns[‘change_author’] = ‘Author’; } return $columns; } add_filter(‘manage_media_columns’, ‘custom_media_columns’); // Display the ‘Change Author’…Continue reading
add_filter( ‘aioseo_breadcrumbs_trail’, ‘homeshop_breadcrumbs_trail’ ); function homeshop_breadcrumbs_trail( $crumbs ) { foreach ( $crumbs as &$crumb ) { if(false !== is_product()){ if ( ‘Products’ === $crumb[‘label’] ) { $crumb[‘label’] = ‘Store’; } } } return $crumbs; }Continue reading
/** * 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
function export_tags_and_categories() { $terms = get_terms( array( ‘category’, ‘post_tag’ ), array( ‘hide_empty’ => false ) ); $output = fopen( ‘php://output’, ‘w’ ); fputcsv( $output, array( ‘Term ID’, ‘Name’, ‘Slug’, ‘Description’, ‘Taxonomy’ ) ); foreach ( $terms as $term ) {…Continue reading
add_filter( ‘aioseo_schema_output’, ‘aioseo_product_schema_remove_price’ ); function aioseo_product_schema_remove_price( $schema ) { foreach ( $schema as $index => $graph ) { if ( ‘Product’ === $graph[‘@type’] ) { if ( ! empty( $graph[‘offers’][‘price’] ) ) { unset( $schema[ $index ][‘offers’][‘price’] ); } }…Continue reading
function auto_assign_remove_offers_category() { // Define the “Offers” category slug $offers_category_slug = ‘offers’; // Get the “Offers” category object $offers_category = get_term_by(‘slug’, $offers_category_slug, ‘product_cat’); // If the “Offers” category does not exist, create it if (!$offers_category) { wp_insert_term( ‘Offers’, // Category…Continue reading
add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { return ”; }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
add_filter( ‘simpay_phone_countries’, function() { return array( ‘au’ => ‘Australia’, ); } );Continue reading