Return to Snippet

Revision: 69341
at June 2, 2015 03:08 by sp-firefly


Initial Code
public function run() {

		foreach ( $this->filters as $hook ) {
			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
		}

		foreach ( $this->actions as $hook ) {
			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
		}

		/* Adding custom filter to change the Post Title palceholder text */
		function change_title_text( $title ) {
			$screen = get_current_screen();
				if  ( 'child_sponsorship' == $screen->post_type ) {
					$title = 'Enter child name';
				}
				return $title;
		}

		add_filter( 'enter_title_here', 'change_title_text' );


	}

Initial URL


Initial Description
add_filter in plugin

Initial Title
add_filter in wp plugin for custom post type

Initial Tags


Initial Language
PHP