[wp-hackers] get_page_templates

Barrett Golding bg at hearingvoices.com
Mon Apr 22 16:06:34 UTC 2013


re-sending this w/ more info.
i believe the Codex page for get_page_templates() has bad info:
http://codex.wordpress.org/Function_Reference/get_page_templates

before i correct it, i wanted to run it by this maillist.

following the Codex usage by calling: 
get_page_templates();
throws a fatal Undeclared Function error.

the Codex lists this function's source file as:
/wp-admin/includes/theme.php

calling any function in that file also throws same error.
in fact, i can't find any file in all WP core that loads: /wp-admin/includes/theme.php

there is another get_page_templates() in:
/wp-includes/class-wp-theme.php

it's a method of the WP_Theme class. and this call works just fine:
wp_get_theme()->get_page_templates();

b/c wp_get_theme() creates a new WP_Theme object:
/wp-includes/theme.php

so what i'd like to do in Codex is replace the error-throwing
usage, examples, and source file, with the above info.

before i do, wanted to make sure i wasn't overlooking anything.
thanks to anyone that can advise...


On Apr 18, 2013, at 10:35 PM, Barrett Golding <bg at hearingvoices.com> wrote:
> I'm revising some Page Template stuff over at Codex,
> and came upon something i need y'all's consult on:
> http://codex.wordpress.org/Function_Reference/get_page_templates
> 
> seems like calling just: get_page_templates();
> 
> gets you a fatal Undeclared Function error. what's works is:
> wp_get_theme()->get_page_templates()
> 
> if so, i should correct the above url.
> but wanted to check w/ you Core Kids first.
> 
> bg
> -- 
> <http://HearingVoices.com/>
> ~radio active transmissions~
> 

bg
-- 
<http://HearingVoices.com/>
~radio active transmissions~



More information about the wp-hackers mailing list