Created
April 30, 2015 17:35
-
-
Save blickwert/91a7779b232e540c2aaf to your computer and use it in GitHub Desktop.
ACF functionality
http://www.advancedcustomfields.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ADD ACF optionspage*/ | |
if( function_exists('acf_add_options_sub_page') ) { | |
acf_add_options_sub_page(array( | |
'title' => '[Custom title]', | |
'parent' => '[edit.php?post_type=myposttype]', | |
)); | |
acf_add_options_sub_page('[mypagename]'); | |
acf_add_options_page(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* acf custom function */ | |
function get_field_exist($name, $id='') { | |
if ( function_exists('get_field') && get_field($name, $id) ) { | |
return get_field($name, $id); | |
} else { | |
return false; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* acf custom function for strings */ | |
function get_field_exist_string($name, $id='', $before='', $after='') { | |
return ( function_exists('get_field') && get_field($name, $id) ? $before.get_field($name, $id).$after : false ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment