• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / get_reading_settings() – Presents show_on_front, page_on_front, and page_for_posts settings.

You appear to be a bot. Output may be restricted

Description

Presents show_on_front, page_on_front, and page_for_posts settings.

These settings are not currently offered by the WordPress REST API. We could switch to wp endpoints once the settings are exposed there. Example: curl https://example.com/wp-json/genesis/v1/reading-settings Example response: {"show_on_front":"page","page_on_front":123,"page_for_posts":456}

Usage

get_reading_settings();

Parameters

Returns

void

Source

File name: genesis/lib/functions/rest.php


Lines:

1 to 18 of 18
function get_reading_settings() {
  \register_rest_route(
    'genesis/v1',
    '/reading-settings',
    [
      'methods'             => 'GET',
      'callback'            => function() {
        return [
          'show_on_front'  => \get_option( 'show_on_front' ),
          'page_on_front'  => (int) \get_option( 'page_on_front' ),
          'page_for_posts' => (int) \get_option( 'page_for_posts' ),
        ];
      },
      'permission_callback' => '__return_true',
    ]
  );
}
 

Published: 25th November 2019 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: get_reading_settings
Plugin ref: Genesis Framework
Version: 3.3.5
Sourcefile: lib/functions/rest.php
File ref: lib/functions/rest.php
Deprecated?: No
API Letters: G,R,S

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites