WordPress.org

Ready to get started?Download WordPress

Forums

Edit Flow
[resolved] How to get a post status description in Edit Flow (4 posts)

  1. web559
    Member
    Posted 1 year ago #

    How can I access an Edit Flow post status description? After some trial and error and looking at custom-status.php, I gather that it is not saved as a standard term description. Thus, this didn't work:

    $status_slug = get_post_status();
    	$status_object = get_term_by( 'slug', $status_slug, 'post_status' );
    	$status_id = $status_object->term_id;
    	$status_description = term_description( (int) $term_id, 'post_status' );
    	echo $status_description;

    How would I properly do this?

    http://wordpress.org/extend/plugins/edit-flow/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Try this instead:

    $status = EditFlow()->custom_statuses->get_custom_status_by( 'slug', get_post_status() );

    $status should have $status->description.

    Whatcha working on?

  3. web559
    Member
    Posted 1 year ago #

    When I add that, I'm getting Fatal error: Call to a member function get_custom_status_by() on a non-object — I am using it in the context of a filter (on ef_notification_recipients); how would I get this to work?

    What I'm attempting to do is globally control who gets which status notifications. In my organization, different email lists need to know about a post at different stages in the production process, and rather than adding people to the notification checklist on a per-post basis at each stage, I want to attach default list of email addresses to each post status. Did that make sense?

    I was using status descriptions to specify a simple comma-separated list of email addresses to associate with each post status. There's surely a nicer way to do it, but I thought this would be easy to set up and manage, and I need it to be editable from the front end.

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Derp, it should be this instead:

    $status = EditFlow()->custom_status->get_custom_status_by( 'slug', get_post_status() );

    I was using status descriptions to specify a simple comma-separated list of email addresses to associate with each post status. There's surely a nicer way to do it, but I thought this would be easy to set up and manage, and I need it to be editable from the front end.

    If they're WordPress users, you can create user groups to manage that. Otherwise, your approach sounds fine.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic