/** * the action row link based on the status * * @param [type] $actions [description] * @param [type] $post [description] * @return [type] [description] */ public function yourls_row_action($actions, $post) { // make sure we're working with an approved post type if (!in_array($post->post_type, YOURLSCreator_Helper::get_yourls_types())) { return $actions; } // bail if we aren't working with a published or scheduled post if (!in_array(get_post_status($post->ID), YOURLSCreator_Helper::get_yourls_status())) { return $actions; } // check for existing and add our new action if (false === ($exist = YOURLSCreator_Helper::get_yourls_meta($post->ID))) { $actions['create-yourls'] = YOURLSCreator_Helper::create_row_action($post->ID); } else { $actions['update-yourls'] = YOURLSCreator_Helper::update_row_action($post->ID); } // return the actions return $actions; }