redirection_monitor_created

redirection_monitor_created

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: redirection.5.7.3

do_action('redirection_monitor_created') is found 2 times:

  • /models/monitor.php line 158
    		if ( $data['url'] !== null && $data['url'] !== false && $data['url'] !== '/' ) {
    			$new_item = Red_Item::create( $data );
    
    			if ( ! is_wp_error( $new_item ) ) {
    				do_action( 'redirection_monitor_created', $new_item, $data['url'], $post_id );
    			}
    		}
    	}
    
    	/**
    	 * Changed if permalinks are different and the before wasn't the site url (we don't want to redirect the site URL)
    
  • /models/monitor.php line 228
    			// Create a new redirect for this post
    			$new_item = Red_Item::create( $data );
    
    			if ( ! is_wp_error( $new_item ) ) {
    				do_action( 'redirection_monitor_created', $new_item, $before, $post_id );
    
    				if ( ! empty( $this->associated ) ) {
    					// Create an associated redirect for this post
    					$data['url'] = trailingslashit( $data['url'] ) . ltrim( $this->associated, '/' );
    					$data['action_data'] = array( 'url' => trailingslashit( $data['action_data']['url'] ) . ltrim( $this->associated, '/' ) );
    					Red_Item::create( $data );