Settings'; array_unshift($links, $settings_link); return $links; } $plugin = plugin_basename(__FILE__); add_filter("plugin_action_links_$plugin", 'your_plugin_settings_link' ); //get the settings from database $ssb = get_option("ssb_options"); //activate/de-activate hooks //dont change it, its required function ssb_activation() {} function ssb_deactivation() {} register_activation_hook(__FILE__, 'ssb_activation'); register_deactivation_hook(__FILE__, 'ssb_deactivation'); /// this is a wordpress action which adds a page link in the wordpress admin panel bu calling my function ssb_settings add_action('admin_menu', 'ssb_settings'); //adding a page link in admin panel function ssb_settings() { add_options_page( "FirstImpression.io", "FirstImpression.io", 'administrator', 'firstimpression', 'ssb_admin_function'); //this adds the page: parameters are: "page title", "link title", "role", "slug","function that shows the result" } if ( ! is_admin() ) { //printing the script add_action('wp_head','ssb_output_g'); //print in header add_action('wp_footer','ssb_page_data'); //print in footer } //main function, returns the output function ssb_output() { //get the settings from database $ssb = get_option("ssb_options"); $siteId = isset($ssb['site_id']) ? $ssb['site_id'] : 0; //adding the script result in a variable $output = << SCRIPT; //output created, now returning it back to the calling element ! return $output; } function ssb_page_data_demo() { global $pluginVersion, $wp_version; $output = "
"; echo $output; } function ssb_page_data() { global $post, $pluginVersion, $wp_version; //Returns All category Items $term_array = wp_get_post_terms($post->ID, 'category', array("fields" => "names")); $category_list = ( empty($term_array) OR is_wp_error($term_array) ) ? '' : implode(',', $term_array); //Returns Array of Tag Names $term_array = wp_get_post_terms($post->ID, 'post_tag', array("fields" => "names")); $tag_list = ( empty($term_array) OR is_wp_error($term_array) ) ? '' : implode(',', $term_array); $display_name = get_the_author_meta('display_name'); $display_name = ( empty($display_name) OR is_wp_error($display_name) ) ? '' : $display_name; $output = ''; $output .= "\n" . '\n\n"; echo $output; } //this echo's the code function ssb_output_g() { echo ssb_output(); } //biggest function but worth it function ssb_admin_function() { ssb_ajax_javascript(); //check if the user is allowed to edit wordress settings if(!current_user_can('manage_options')) wp_die('You do not have sufficient permissions to access this page.'); //die if not allowed $ssb = get_option("ssb_options"); //get saved settings to initially show in form //here starts the html of form, cant document the html (Do you really need this ? do you!) ?>FirstImpression.io is a tool which allows you to easily add monetizable ad products to your site. This plugin will provide the integration to allow the placements on your site to be managed through FirstImpression.io's platform. Just add the site id you got from your account manager, click the "Updated Embedded Code" button and you are good to go.
Click here to login to your admin console on FirstImpression.io and manage your placements