Note that there are some explanatory texts on larger screens.

plurals
  1. POWrong WordPress Theme Option Page PHP - stuck
    primarykey
    data
    text
    <p>OK... I've been looking at this thing forever and I have to admit defeat.</p> <p>I'm piecing together an Options Page for a WordPress Theme, and I'm getting a</p> <p>"Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'flaunt_one_theme_options' was given in /home/bahia001/public_html/test/wp-includes/plugin.php on line 405" Error. </p> <p>I know that this is probably due to incorrect nomenclature between the code snippets I used to put this together, but I need a little guidance. I'm kinda new to PHP.</p> <hr> <p>This is my code:</p> <pre><code>&lt;?php //Theme Options function my_admin_scripts(){ wp_enqueue_script('media-upload'); } if (isset($_GET['page']) &amp;&amp; $_GET['page'] == 'folio-themes-setup') { add_action('admin_print_scripts', 'my_admin_scripts'); add_action('admin_print_styles', 'my_admin_styles'); } add_action('admin_menu', 'flaunt_one_create_menu'); function flaunt_one_create_menu() { add_menu_page('Flaunt One Options', 'Flaunt One Options', 'administrator','folio-themes-setup', 'flaunt_one_theme_options',get_bloginfo('stylesheet_directory')."/images/flaunt16.png",63); add_action( 'admin_init', 'register_mysettings' ); } function register_mysettings() { register_setting( 'flaunt-one-settings-group', 'flaunt_one_logo'); register_setting( 'flaunt-one-settings-group', 'flaunt_one_favico'); } function sw_settings_page() { ?&gt; &lt;div class="wrap"&gt; &lt;?php screen_icon(); echo "&lt;h2&gt;" . get_current_theme() . __( 'Options', 'flaunt_one' ) . "&lt;/h2&gt;"; ?&gt; &lt;div id="flaunt-options" style="width:800px; float:left;"&gt; &lt;?php if ( false !== $_REQUEST['settings-updated'] ) : ?&gt; &lt;div class="updated fade"&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e( 'Options saved', 'flaunt_one' ); ?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt; &lt;?php endif; ?&gt; &lt;form method="post" action="options.php"&gt; &lt;?php settings_fields( 'flaunt_one_options' ); ?&gt; &lt;?php $options = get_option( 'flaunt_one_theme_options' ); ?&gt; &lt;table class="form-table"&gt; &lt;tr valign="top"&gt; &lt;th scope="row"&gt;&lt;h3&gt;Style Options:&lt;/h3&gt;&lt;/th&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr valign="top"&gt; &lt;th scope="row"&gt;Logo:&lt;/th&gt; &lt;td&gt;&lt;input size="53" type="text" name="sw_logo" value="&lt;?php echo get_option('flaunt_one_logo'); ?&gt;" /&gt;&lt;input class="upload_image_button" type="button" value="Upload" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;? if(get_option('flaunt_one_logo')){ ?&gt; &lt;tr valign="top"&gt; &lt;th scope="row"&gt;&lt;/th&gt; &lt;td&gt;&lt;img src="&lt;?php echo get_option('flaunt_one_logo'); ?&gt;" alt="" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;? } ?&gt; &lt;tr valign="top"&gt; &lt;th scope="row"&gt;Favicon:&lt;/th&gt; &lt;td&gt;&lt;input size="53" type="text" name="favico" value="&lt;?php echo get_option('flaunt_one_favico'); ?&gt;" /&gt;&lt;input class="upload_image_button" type="button" value="Upload" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;h3&gt;Social Media Icons:&lt;/h3&gt; &lt;p&gt;&lt;?php _e( 'These options will let you setup the social icons at the top of the theme. You can enter the URLs of your profiles to have the icons show up.', 'flaunt_one' ); ?&gt;&lt;/p&gt; &lt;table class="form-table"&gt; &lt;?php /** * Facebook Icon */ ?&gt; &lt;tr valign="top"&gt;&lt;th scope="row"&gt;&lt;?php _e( 'Enter your Facebook URL', 'flaunt_one' ); ?&gt;&lt;/th&gt; &lt;td&gt; &lt;input id="flaunt_one_theme_options[facebookurl]" class="regular-text" type="text" name="flaunt_one_theme_options[facebookurl]" value="&lt;?php esc_attr_e( $options['facebookurl'] ); ?&gt;" /&gt; &lt;label class="description" for="flaunt_one_theme_options[facebookurl]"&gt;&lt;?php _e( 'Leave blank to hide Facebook Icon', 'flaunt_one' ); ?&gt;&lt;/label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php /** * Twitter URL */ ?&gt; &lt;tr valign="top"&gt;&lt;th scope="row"&gt;&lt;?php _e( 'Enter your Twitter URL', 'flaunt_one' ); ?&gt;&lt;/th&gt; &lt;td&gt; &lt;input id="flaunt_one_theme_options[twitterurl]" class="regular-text" type="text" name="flaunt_one_theme_options[twitterurl]" value="&lt;?php esc_attr_e( $options['twitterurl'] ); ?&gt;" /&gt; &lt;label class="description" for="flaunt_one_theme_options[twitterurl]"&gt;&lt;?php _e( 'Leave blank to hide Twitter Icon', 'flaunt_one' ); ?&gt;&lt;/label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php /** * Google+ URL */ ?&gt; &lt;tr valign="top"&gt;&lt;th scope="row"&gt;&lt;?php _e( 'Enter your Google+ URL', 'flaunt_one' ); ?&gt;&lt;/th&gt; &lt;td&gt; &lt;input id="flaunt_one_theme_options[googleplusurl]" class="regular-text" type="text" name="flaunt_one_theme_options[googleplusurl]" value="&lt;?php esc_attr_e( $options['googleplusurl'] ); ?&gt;" /&gt; &lt;label class="description" for="flaunt_one_theme_options[googleplusurl]"&gt;&lt;?php _e( 'Leave blank to hide Google+ Icon', 'flaunt_one' ); ?&gt;&lt;/label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php /** * Pinterest URL */ ?&gt; &lt;tr valign="top"&gt;&lt;th scope="row"&gt;&lt;?php _e( 'Enter your Pinterest URL', 'flaunt_one' ); ?&gt;&lt;/th&gt; &lt;td&gt; &lt;input id="flaunt_one_theme_options[pinteresturl]" class="regular-text" type="text" name="flaunt_one_theme_options[pinteresturl]" value="&lt;?php esc_attr_e( $options['pinteresturl'] ); ?&gt;" /&gt; &lt;label class="description" for="flaunt_one_theme_options[pinteresturl]"&gt;&lt;?php _e( 'Leave blank to hide Pinterest Icon', 'flaunt_one' ); ?&gt;&lt;/label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php /** * RSS Icon */ ?&gt; &lt;tr valign="top"&gt;&lt;th scope="row"&gt;&lt;?php _e( 'Enter your RSS URL', 'flaunt_one' ); ?&gt;&lt;/th&gt; &lt;td&gt; &lt;input id="flaunt_one_theme_options[rssurl]" class="regular-text" type="text" name="flaunt_one_theme_options[rssurl]" value="&lt;?php esc_attr_e( $options['rssurl'] ); ?&gt;" /&gt; &lt;label class="description" for="flaunt_one_theme_options[rssurl]"&gt;&lt;?php _e( 'Enter your Feedburner url. If you dont have one use "http://yoursitename.com/feed/"', 'flaunt_one' ); ?&gt;&lt;/label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;p class="submit"&gt; &lt;input type="submit" class="button-primary" value="&lt;?php _e( 'Save Options', 'flaunt_one' ); ?&gt;" /&gt; &lt;/p&gt; &lt;/form&gt; &lt;/div&gt; &lt;!-- End Social Share Buttons --&gt; &lt;!-- Sharing Column --&gt; &lt;div id="share-column" style="float:right;"&gt; &lt;!-- Begin MailChimp Signup Form --&gt; &lt;div id="flaunt-mc-signup"&gt; &lt;link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css"&gt; &lt;div id="mc_embed_signup"&gt; &lt;form action="http://flauntyoursite.us2.list-manage.com/subscribe/post?u=9d1d3626942e4f97eb4bb6699&amp;amp;id=b85f19e2d3" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank"&gt; &lt;label for="mce-EMAIL"&gt;Subscribe to our mailing list&lt;/label&gt; &lt;input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required&gt; &lt;div class="clear"&gt;&lt;input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button-primary"&gt;&lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--End mc_embed_signup--&gt; &lt;!-- Begin Sharing Section --&gt; &lt;div class="flaunt-share"&gt; &lt;p&gt;Could you do me a &lt;strong&gt;huge&lt;/strong&gt; favor and share this plugin with others. Thank you so much!&lt;/p&gt; &lt;ul style="list-style:none;"&gt; &lt;li&gt;&lt;?php echo flaunt_like_facebook(); ?&gt; &lt;?php } //Render Facebook Like button //http://developers.facebook.com/docs/reference/plugins/like/ //TODO Not using since correct image isn't coming up for now function flaunt_like_facebook() { ?&gt; &lt;div id="fb-root"&gt; &lt;/div&gt; &lt;script&gt;(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=237425446277620"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));&lt;/script&gt; &lt;div class="fb-like" data-href="http://flauntyoursite.com" data-send="false" data-layout="button_count" data-width="150" data-show-faces="false"&gt;&lt;/div&gt; &lt;/li&gt; &lt;li&gt;&lt;?php echo flaunt_share_twitter(); ?&gt; &lt;? php } //Render Twitter button //https://twitter.com/about/resources/buttons function flaunt_share_twitter() { ?&gt; &lt;a href="https://twitter.com/share" class="twitter-share-button" data-url="http://flauntyoursite.com/" data-text="Flaunt Your Site - We Get Photographers Noticed!" alt="Tweet this!"&gt;Tweet&lt;/a&gt; &lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0];if(!d.getElementById(id)) {js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");&lt;/script&gt; &lt;/li&gt; &lt;li&gt;&lt;?php echo flaunt_share_google_plus(); ?&gt; &lt;?php } //Render Google +1 button //http://www.google.com/intl/en/webmasters/+1/button/index.html function flaunt_share_google_plus() { ?&gt; &lt;!-- Place this tag where you want the +1 button to render --&gt; &lt;div class="g-plusone" data-size="medium" data-href="http://flauntyoursite.com/"&gt; &lt;/div&gt; &lt;!-- Place this render call where appropriate --&gt; &lt;script type="text/javascript"&gt; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); &lt;/script&gt; &lt;/li&gt; &lt;li&gt;(Or &lt;a href="http://wordpress.org/extend/plugins/#/" target="_blank"&gt;rate it on WordPress&lt;/a&gt;) &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- End Sharing Section --&gt; &lt;/div&gt; &lt;!-- End Sharing Column --&gt; &lt;/div&gt; &lt;!-- End Wrapper --&gt; &lt;?php } /** * Sanitize and validate input. Accepts an array, return a sanitized array. */ function flaunt_one_options_validate( $input ) { // Our text option must be safe text with no HTML tags $input['twitterurl'] = wp_filter_nohtml_kses( $input['twitterurl'] ); $input['facebookurl'] = wp_filter_nohtml_kses( $input['facebookurl'] ); $input['googleplusurl'] = wp_filter_nohtml_kses( $input['googleplusurl'] ); $input['pinteresturl'] = wp_filter_nohtml_kses( $input['pinteresturl'] ); $input['feedurl'] = wp_filter_nohtml_kses( $input['feedurl'] ); // Encode URLs $input['twitterurl'] = esc_url_raw( $input['twitterurl'] ); $input['facebookurl'] = esc_url_raw( $input['facebookurl'] ); $input['googleplusurl'] = esc_url_raw( $input['googleplusurl'] ); $input['pinteresturl'] = esc_url_raw( $input['pinteresturl'] ); $input['feedurl'] = esc_url_raw( $input['feedurl'] ); return $input; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload