e, ) ); } /** * Maybe set the default gateway. * * @param int $post_id Post ID. * @return void */ public function maybe_set_default_gateway( $post_id ) { // Don't set the default gateway if the post is not published. if ( 'publish' !== get_post_status( $post_id ) ) { return; } // Don't set the default gateway if there is already a published gateway set. $config_id = get_option( 'pronamic_pay_config_id' ); if ( ! empty( $config_id ) && 'publish' === get_post_status( $config_id ) ) { return; } // Update. update_option( 'pronamic_pay_config_id', $post_id ); } /** * Get capabilities for this post type. * * @return array */ public static function get_capabilities() { return array( 'edit_post' => 'manage_options', 'read_post' => 'manage_options', 'delete_post' => 'manage_options', 'edit_posts' => 'manage_options', 'edit_others_posts' => 'manage_options', 'publish_posts' => 'manage_options', 'read_private_posts' => 'manage_options', 'read' => 'manage_options', 'delete_posts' => 'manage_options', 'delete_private_posts' => 'manage_options', 'delete_published_posts' => 'manage_options', 'delete_others_posts' => 'manage_options', 'edit_private_posts' => 'manage_options', 'edit_published_posts' => 'manage_options', 'create_posts' => 'manage_options', ); } }