Tagged: 

Viewing 2 reply threads
  • Author
    Posts
    • #3370
      cyclissmo
      Member

      I’m finding myself at a loss: registering custom post statuses are as easy as pie, and so are retrieving them. But I’m at a complete loss as to how the ‘label‘ portion of the argument is retrieved:

      'refund' => array(
      	'label' => 'Refunded'
      ),
      'paid' => array(
      	'label' => 'Paid'
      )

      I’m assuming it has something to do with translation, but I tried __( ‘refund’, ‘piklist’ ) but no dice. Any clues?

    • #3371
      cyclissmo
      Member

      Solved! I found the answer right after posting:

      get_post_status_object( get_post_status( $post->ID) )

      Which returns something like this:

      stdClass Object ( [label] => CC Authorization [label_count] => Array ( [0] => CC Authorization (%s) [1] => CC Authorization (%s) [singular] => CC Authorization (%s) [plural] => CC Authorization (%s) [context] => [domain] => ) [exclude_from_search] => [_builtin] => [public] => 1 [internal] => [protected] => 1 [private] => [publicly_queryable] => 1 [show_in_admin_status_list] => 1 [show_in_admin_all_list] => 1 [capability_type] => jnl_subscription_txn [hierarchical] => [has_archive] => [show_in_admin_all] => [single_view_cap] => [name] => authorize )

    • #3372
      Steve
      Keymaster

      @cyclissmo– Since Piklist does everything the WordPress way, you can usually use standard WordPress functions to retrieve your data. Good job!

Viewing 2 reply threads
  • The topic ‘How to retrieve custom post status label?’ is closed to new replies.