action_dispatcher(); $this->filter_dispatcher(); } /** * The action dispatcher, that calls needed WordPress actions for this class. */ function action_dispatcher() { } /** * The action dispatcher, that calls needed WordPress filter for this class. */ function filter_dispatcher() { add_filter( 'admin_footer_text', array( $this, 'lh_admin_footer' ) ); // change admin footer text. add_filter( 'excerpt_more', array( $this, 'excerpt_more' ), 10 ); add_filter( 'the_content_more_link', array( $this, 'excerpt_more' ), 10 ); add_filter( 'comment_form_defaults', array( $this, 'comment_form_defaults' ) ); } /** * Echoes custom text in the admin footer, is called by "admin_footer_text" filter * * @author Hendrik Luehrsen * @since 1.0 * * @return void */ function lh_admin_footer() { $url = __( 'http://www.wp-munich.com', 'agncy' ); $name = __( 'WP Munich', 'agncy' ); $made_with = __( 'Made with ♡ by ', 'agncy' ); $powered_by = __( 'Powered by', 'agncy' ); echo '' . esc_html( $made_with ) . ' ' . esc_attr( $name ) . '. ' . esc_html( $powered_by ) . ' WordPress.'; } /** * The custom "read more" link. * * @access public * @param string $more The default more link. * @return string $more The custom more link. */ public function excerpt_more( $more ) { $readmore = __( 'Read more', 'agncy' ); $more = '' . esc_html( $readmore ) . ' '; return $more; } /** * The URL to the posts page. * * @return string url to the posts page */ function agncy_get_post_page_url() { if ( 'page' == get_option( 'show_on_front' ) ) { return get_permalink( get_option( 'page_for_posts' ) ); } else { return home_url(); } } /** * Filter the default values for comment form fields. * * @param array $defaults Comment form defaults. * * @return array The modified defaults */ public function comment_form_defaults( $defaults ) { $defaults = array_merge( $defaults, array( 'title_reply_before' => '

', 'title_reply' => '' . __( 'Leave a Reply', 'agncy' ) . '', // translators: the name of the author of the reply to comment. 'title_reply_to' => '' . __( 'Leave a Reply to %s', 'agncy' ) . '', 'class_submit' => 'submit has-tertiary-background-color', ) ); return $defaults; } } $_lh_theme_functions = new AgncyThemeFunctions();