WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Override default labels (3 posts)

  1. Ned Zimmerman
    Member
    Posted 1 year ago #

    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/

  2. Ned Zimmerman
    Member
    Posted 1 year ago #

    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' ),
    	);
    }
  3. webmistress666
    Member
    Posted 1 year ago #

    Thanks for this! Huge help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.