• Resolved Ned Zimmerman

    (@greatislander)


    Within class-coauthors-guest-authors.php there’s an array of labels for the Guest Authors admin page that includes the following comment:

    // Set up default labels, but allow themes to modify

    Where would I go about overriding the default labels in my theme? I dropped the following into my theme’s functions.php but it looks like the class has already been initialized with the default labels before the override takes effect. Thanks in advance for your help.

    global $coauthors_plus;
    $coauthors_plus->labels = array(
    	'singular' => __( 'Author Profile', 'co-authors-plus' ),
    	'plural' => __( 'Author Profiles', 'co-authors-plus' ),
    	'all_items' => __( 'All Author Profiles', 'co-authors-plus' ),
    	'add_new_item' => __( 'Add New Author Profile', 'co-authors-plus' ),
    	'edit_item' => __( 'Edit Author Profile', 'co-authors-plus' ),
    	'new_item' => __( 'New Author Profile', 'co-authors-plus' ),
    	'view_item' => __( 'View Author Profile', 'co-authors-plus' ),
    	'search_items' => __( 'Search Author Profiles', 'co-authors-plus' ),
    	'not_found' => __( 'No author profiles found', 'co-authors-plus' ),
    	'not_found_in_trash' => __( 'No author profiles found in Trash', 'co-authors-plus' ),
    	'update_item' => __( 'Update Author Profile', 'co-authors-plus' ),
    	'metabox_about' => __( 'About the author', 'co-authors-plus' ),
    );

    http://wordpress.org/extend/plugins/co-authors-plus/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ned Zimmerman

    (@greatislander)

    Solution as follows (figured it out myself):

    add_filter('coauthors_guest_author_labels', 'custom_cap_labels');
    
    function custom_cap_labels() {
    	return array(
    		'singular' => __( 'Author Profile', 'co-authors-plus' ),
    		'plural' => __( 'Author Profiles', 'co-authors-plus' ),
    		'all_items' => __( 'All Author Profiles', 'co-authors-plus' ),
    		'add_new_item' => __( 'Add New Author Profile', 'co-authors-plus' ),
    		'edit_item' => __( 'Edit Author Profile', 'co-authors-plus' ),
    		'new_item' => __( 'New Author Profile', 'co-authors-plus' ),
    		'view_item' => __( 'View Author Profile', 'co-authors-plus' ),
    		'search_items' => __( 'Search Author Profiles', 'co-authors-plus' ),
    		'not_found' => __( 'No author profiles found', 'co-authors-plus' ),
    		'not_found_in_trash' => __( 'No author profiles found in Trash', 'co-authors-plus' ),
    		'update_item' => __( 'Update Author Profile', 'co-authors-plus' ),
    		'metabox_about' => __( 'About the author', 'co-authors-plus' ),
    	);
    }

    Thanks for this! Huge help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Override default labels’ is closed to new replies.