/** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form($instance) { fb_get_send_fields('widget', $this); }
/** * The settings page * * @since 1.0 */ function fb_settings_page() { global $facebook; $like_button_options = array("enabled" => "true", "send" => "true", "layout" => "button_count", "action" => "like", "colorscheme" => "light", "font" => "arial", "position" => "both", "ref" => "wp", "href" => "http://developers.facebook.com/wordpress"); ?> <div class="wrap"> <div class="facebook-logo"></div> <h2><?php echo esc_html__('Facebook for WordPress', 'facebook') . ' ' . fb_get_like_button($like_button_options); ?> </h2> <?php settings_errors(); ?> <form method="post" action="options.php"> <?php settings_fields('fb_options'); if (!isset($facebook)) { echo '<h2>' . esc_html__('Step 1: Create an App', 'facebook') . '</h2>'; echo '<p><strong>' . sprintf(esc_html(__('If you already have a Facebook app for this website, skip to %sStep 2%s.', 'facebook')), '<a href="#step-2">', '</a>') . '</strong></p><br>'; echo '<p>' . sprintf(esc_html(__('If you don\'t already have an app for this website, go to %s and click the "Create New App" button. You\'ll see a dialog like the one below. Fill this in and click "Continue".', 'facebook')), '<a href="https://developers.facebook.com/apps" target="_blank">https://developers.facebook.com/apps</a>'); echo '<p><img src="' . plugins_url('images/nux_create_app.png', __FILE__) . '"></p>'; echo "</br>Here are for some recommendations for filling this form out. </br>"; echo "<b> App Name: </b>" . get_bloginfo('name') . "</br>"; echo "<b> App Namespace: </b>" . strtolower(str_replace(" ", "-", get_bloginfo('name'))) . '-' . rand(0, 999) . "</br>"; echo '<a name="step-2"></a><h2>' . esc_html__('Step 2: Set up the App', 'facebook') . '</h2>'; echo sprintf(esc_html(__('Next, set up your app so that it looks like the settings below. Make sure you set your app\'s icon and image, too. If you already have an app and skipped Step 1, you can view your app settings by going to %s', 'facebook')), '<a href="https://developers.facebook.com/apps">https://developers.facebook.com/apps</a>.</p>'); echo "</br>Here are for some recommendations for filling this form out, based on where this plugin is installed.</br>"; echo "<b> App Domains: </b>" . parse_url(home_url('/'), PHP_URL_HOST) . "</br>"; echo "<b> Site URL and Mobile Web URL: </b> " . get_bloginfo('wpurl') . "</br>"; echo '<p><img src="' . plugins_url('images/nux_app_settings.png', __FILE__) . '" style="border: 1px solid #ccc; margin: 5px; padding: 5px;"></p>'; echo '<h2>' . esc_html__('Step 3: WordPress settings', 'facebook') . '</h2>'; echo '<p>' . esc_html__('Now, based on what you entered in Step 2, fill in the settings below and Save. Once saved, additional options will appear on this page.', 'facebook') . '</p>'; fb_get_main_settings_fields(); } else { echo '<h2>' . esc_html__('Main Settings', 'facebook') . '</h2>'; echo '<p>' . sprintf(esc_html(__('Get your App ID, Secret, and Namespace at %s. %sIf you already have a Facebook app for this website, it\'s important that you use the same information below%s.', 'facebook')), '<a href="https://developers.facebook.com/apps">https://developers.facebook.com/apps</a>', '<strong>', '</strong>') . '</p>'; fb_get_main_settings_fields(); echo '<h2>' . esc_html__('Post and Page Settings', 'facebook') . '</h2>'; echo '<p>' . sprintf(esc_html(__('These settings affect Pages and Posts only. Additional Social Plugins are also available in the %sWidgets settings%s.', 'facebook')), '<a href="widgets.php">', '</a>'); fb_notify_user_of_plugin_conflicts(); fb_get_social_publisher_fields(); fb_get_like_fields(); fb_get_subscribe_fields(); fb_get_send_fields(); fb_get_comments_fields(); fb_get_recommendations_bar_fields(); } submit_button(); fb_get_debug_output(); fb_insights_admin(); ?> </form> </div> <?php }