. */ /** * Defining plugin location */ define( 'PLUGIN_DIR', plugin_dir_path(__FILE__).'/' ); /** * Loading supporting files */ include "admin/admin.php"; // Plugin admin options setup /* | ------------------------------------------------------------------- | Enqueue Scripts | ------------------------------------------------------------------- | | */ function async_share_js_loader() { wp_enqueue_script('async_js', plugins_url( 'assets/js/async-share.js', __FILE__ ), array('jquery'),'', true ); } add_action('wp_enqueue_scripts', 'async_share_js_loader'); /* | ------------------------------------------------------------------- | Enqueue Styles | ------------------------------------------------------------------- | | */ function async_share_css_loader() { wp_enqueue_style('async_css', plugins_url( 'assets/css/async-share.css', __FILE__ ), false ,'1.0', 'all' ); } add_action('wp_enqueue_scripts', 'async_share_css_loader'); /* | ------------------------------------------------------------------- | Plugin Link to Settings Page | ------------------------------------------------------------------- | | */ function async_share_plugin_action_links( $links, $file ) { static $this_plugin; if (!$this_plugin) $this_plugin = plugin_basename(__FILE__); if ($file == $this_plugin){ $async_share_settings_link = ''.__('Settings').''; // make the 'Settings' link appear first array_unshift( $links, $async_share_settings_link ); } return $links; } /* | ------------------------------------------------------------------- | Async Share Content | * added to bottom of posts | ------------------------------------------------------------------- | | */ add_filter('the_content', 'async_share_display'); function async_share_display($content) { $options = get_option('async_share_options'); if ($options['twitter'] == TRUE) { $twitter = '