/** * Constructor function * * Sets the post object and loads the saved share numbers. * * @param null|object $post * * @access public * @since 1.0.0 * @return void */ public function __construct($post = null) { $this->post = $post; // If no post object was provided, use the current post. if ($this->post == null) { global $post; $this->post = $post; } // Load the settings. $naked_social_share = Naked_Social_Share(); $this->settings = $naked_social_share->settings; $this->url = get_permalink($this->post); if ($this->settings['disable_counters'] != 1) { $this->share_numbers = get_post_meta($this->post->ID, 'naked_shares_count', true); $this->share_numbers = $this->get_share_numbers(); } }
* along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * Include the main plugin class. */ include_once plugin_dir_path(__FILE__) . 'class-naked-social-share.php'; /** * Loads the whole plugin. * * @since 1.0.0 * @return Naked_Social_Share */ function Naked_Social_Share() { $instance = Naked_Social_Share::instance(__FILE__, '1.2.5'); return $instance; } Naked_Social_Share(); /** * The main function used for displaying the share markup. * This can be placed in your theme template file. * * @since 1.0.0 * @return void */ function naked_social_share_buttons() { $share_obj = new Naked_Social_Share_Buttons(); $share_obj->display_share_markup(); }