plugin_name = $plugin_name; $this->version = $version; } /** * Register the stylesheets for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Steempress_sp_Loader as all of the hooks are defined * in that particular class. * * The Steempress_sp_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/steempress_sp-public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Steempress_sp_Loader as all of the hooks are defined * in that particular class. * * The Steempress_sp_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_script( $this->plugin_name."iframeResizer", plugin_dir_url( __FILE__ ) . 'js/iframeResizer.min.js'); wp_enqueue_script( $this->plugin_name."public_js", plugin_dir_url( __FILE__ ) . 'js/steempress_sp-public.js', array( 'jquery' ), $this->version, false ); } public function steempress_sp_comments($content) { $options = get_option($this->plugin_name); if (!isset($options["twoway"])) $options["twoway"] = "off"; if (!isset($options["twoway-front"])) $options["twoway-front"] = "off"; if ($options['twoway'] == "on") { $id = get_the_ID(); $post = get_post($id); $permlink = get_post_meta($id, "steempress_sp_permlink", true); $author_id = $post->post_author; if (!isset($options["username"])) $options["username"] = ""; $author = $options["username"]; if (isset($options['username' . $author_id]) && $options['username' . $author_id] != "") { $author = $options['username' . $author_id]; } $meta_author = get_post_meta($post->ID, 'steempress_sp_author', true); if ($meta_author != $author && $meta_author != "") $author = $meta_author; $steempress = ""; if ($permlink != "" && $author != "") { // If it's the front page, we display a smaller iframe. $steempress = "