action_dispatcher(); $this->filter_dispatcher(); } /** * The action dispatcher, that calls needed WordPress actions for this class. */ function action_dispatcher() { add_action( 'login_enqueue_scripts', array( $this, 'lh_login_logo' ) ); } /** * 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( 'login_headerurl', array( $this, 'lh_login_logo_url' ) ); add_filter( 'login_headertitle', array( $this, 'lh_login_logo_url_title' ) ); 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' ); echo 'Made with ♡ by ' . esc_attr( $name ) . '. Powered by WordPress.'; } /** * Add some css code to change the default logo * Called by action "login_enqueue_scripts". * * @author Hendrik Luehrsen * @since 3.1 */ function lh_login_logo() { ?> Read more '; 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();