hook(); } /** * Hook the functionality of this class into the world */ public function hook() { add_filter( 'tribe_events_after_html', array( $this, 'html_comment_credit' ) ); add_filter( 'admin_footer_text', array( $this, 'rating_nudge' ), 1, 2 ); } /** * Add credit in HTML page source * * @return void **/ public function html_comment_credit( $after_html ) { $html_credit = "\n\n"; $after_html .= apply_filters( 'tribe_html_credit', $html_credit ); return $after_html; } /** * Add ratings nudge in admin footer * * @param $footer_text * * @return string */ public function rating_nudge( $footer_text ) { global $current_screen; // only display custom text on Tribe Admin Pages if ( isset( $current_screen->id ) && ( $current_screen->post_type == TribeEvents::POSTTYPE || strpos( $current_screen->id, 'tribe' ) !== false ) ) { $footer_text = sprintf( __( 'Rate The Events Calendar ★★★★★ on WordPress.org to keep this plugin free. Thanks from the friendly folks at Modern Tribe.', 'tribe-events-calendar' ), __( 'http://wordpress.org/support/view/plugin-reviews/the-events-calendar?filter=5', 'tribe-events-calendar' ) ); } return $footer_text; } /** * @return self */ public static function instance() { if ( empty( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } }