epm_get_pages

Retrieve a list of all published pages only on plugin settings page.

Description

epm_get_pages( (bool) $force = false ); 

Parameters (1)

0. $force — Optional. (bool) => false
The force.

Usage

  1. if ( !function_exists( 'epm_get_pages' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'easy-peasy-mailchimp-ajax-form/includes/admin/settings/register-settings.php'; 
  3.  
  4. // The force. 
  5. $force = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = epm_get_pages($force); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/settings/register-settings.php  
  1. function epm_get_pages( $force = false ) { 
  2.  
  3. $pages_options = array( 0 => '' ); // Blank option 
  4.  
  5. if( ( ! isset( $_GET['page'] ) || 'epm-settings' != $_GET['page'] ) && ! $force ) { 
  6. return $pages_options; 
  7.  
  8. $pages = get_pages(); 
  9. if ( $pages ) { 
  10. foreach ( $pages as $page ) { 
  11. $pages_options[ $page->ID ] = $page->post_title; 
  12.  
  13. return $pages_options;