'; echo __('Thank you for using the Admin Rss Feed plugin! Go to Plugin ', 'admin-dashboard-rss-feed'); echo '' . __('Settings Page', 'admin-dashboard-rss-feed') . ''; echo '

'; ?>
' . __('Settings', 'admin-dashboard-rss-feed') . ''; return $wsx_rss_feed_link; } // Create custom plugin settings menu add_action('admin_menu', 'wsx_rss_feed_admin_page'); function wsx_rss_feed_admin_page() { // create new top-level menu add_options_page('Admin Dashboard RSS Feed Plugin Settings', 'Admin Dashboard RSS Feed', 'manage_options', __FILE__, 'wsx_rss_feed_admin_settings_page'); // call register settings function add_action('admin_init', 'wsx_rss_feed_admin_settings'); } function wsx_rss_feed_styles() { wp_register_style('wsx-rss-styles', plugin_dir_url(__FILE__) . 'admin/css/style.css'); wp_enqueue_style('wsx-rss-styles'); } add_action('admin_enqueue_scripts', 'wsx_rss_feed_styles'); function wsx_rss_feed_admin_settings() { // register our settings // Save attachment ID if (isset($_POST['image_attachment_id'])): update_option('wsx_rss_feed_image_attachment_id', absint($_POST['image_attachment_id'])); endif; if($_GET['page'] == "admin-dashboard-rss-feed/admin-rss-feed.php") { wp_enqueue_media(); } // Get the Company Logo Title register_setting('wsx-rss-feed-settings-group', 'wsx_logo_title'); // Get the Company Logo Target Link register_setting('wsx-rss-feed-settings-group', 'wsx_logo_target_link'); // Feed URL register_setting('wsx-rss-feed-settings-group', 'wsx_rss_feed_url'); // Feed Count register_setting('wsx-rss-feed-settings-group', 'wsx_rss_feed_count'); } function wsx_rss_feed_admin_settings_page() { ?>

Admin Dashboard RSS Feed Settings

Your Company Name:
Your Company Logo:
(We suggest 64 pixels wide x 64 pixels high) '>
Your Company Website:
Your Company RSS Feed URL:
Number of items to display: (You can show between 1 to 10)
"") { $rss_feed_url = esc_attr(get_option('wsx_rss_feed_url')); } else { echo "Enter a valid news feed URL."; } $wsx_logo_url = wp_get_attachment_url(get_option('wsx_rss_feed_image_attachment_id')); $wsx_logo_title = esc_attr(get_option('wsx_logo_title')); $wsx_logo_target_link = esc_attr(get_option('wsx_logo_target_link')); echo '
'; if ($wsx_logo_url <> "" && $wsx_logo_target_link <> "" && $wsx_logo_title <> "") { $title = 'title="' . $wsx_logo_title . '"'; $alt = 'alt="' . $wsx_logo_title . '"'; echo "
"; echo '
' . $wsx_logo_title . ''; echo '' . $wsx_logo_target_link . '
'; } else if ($wsx_logo_url <> "" && $wsx_logo_target_link <> "") { echo "
"; echo '' . $wsx_logo_target_link . '
'; } else if ($wsx_logo_url <> "" && $wsx_logo_title <> "") { $alt = 'alt="' . $wsx_logo_title . '"'; echo "
"; echo '
' . $wsx_logo_title . '
'; } else if ($wsx_logo_title <> "" && $wsx_logo_target_link <> "") { echo '
' . $wsx_logo_title . '

'; echo '' . $wsx_logo_target_link . '
'; } else { if ($wsx_logo_url <> "") { echo "
"; } if ($wsx_logo_title <> "") { echo '
' . $wsx_logo_title . '
'; } if ($wsx_logo_target_link <> "") { echo ""; } } echo '
'; echo ''; } add_action('admin_footer', 'media_selector_print_script'); function media_selector_print_script() { if($_GET['page'] == "admin-dashboard-rss-feed/admin-rss-feed.php") { $wsx_rss_feed_image_attachment_post_id = get_option('wsx_rss_feed_image_attachment_id', 0); ?>