on_load() static public method

Run on WordPress's 'init' hook to register all the post types defined in classes that extend this class.
static public on_load ( )
Example #1
0
        if (count(self::$_post_stack)) {
            $post = array_pop(self::$_post_stack);
        }
    }
    /**
     * Return the post type of the queried object.
     *
     * @return false|null|string
     */
    static function get_queried_post_type()
    {
        $queried_object = get_queried_object();
        return $queried_object instanceof WP_Post ? get_post_type($queried_object) : null;
    }
    /**
     * @return int
     */
    static function max_posts_per_page()
    {
        return self::$_max_posts_per_page;
    }
    /**
     * @param int $value
     */
    static function set_max_posts_per_page($value)
    {
        self::$_max_posts_per_page = absint($value);
    }
}
WPLib_Posts::on_load();