Recipe_Post_Utilities::__construct()

Recipe_Post_Functions constructor.


Source

File: src/core/automator-post-types/uo-recipe/class-recipe-post-utilities.php

	public function __construct() {
		// Add the custom columns to the uo-recipe.
		add_filter( 'manage_uo-recipe_posts_columns', array( $this, 'set_custom_columns' ) );

		// Add the data to the custom columns for uo-recipe.
		add_action( 'manage_uo-recipe_posts_custom_column', array( $this, 'custom_column' ), 10, 2 );

		// Add admin post creation scripts.
		add_action( 'admin_enqueue_scripts', array( $this, 'automator_recipe_scripts' ) );

		// Change to before delete post.
		add_action( 'delete_post', array( $this, 'delete_triggers_actions' ), 10, 1 );

		// Draft when recipe moved to trash.
		add_action( 'wp_trash_post', array( $this, 'draft_triggers_actions' ), 10, 1 );

		// Prepopulate recipe from a URL query (only for admins).
		if ( is_admin() ) {
			add_action( 'wp_insert_post', array( 'Uncanny_Automator\Populate_From_Query', 'maybe_populate' ), 9, 3 );
		}

		// Change Default new recipe post from auto-draft to draft.
		add_action( 'wp_insert_post', array( $this, 'change_default_post_status' ), 10, 3 );

		// Add recipe and redirect to it in edit mode.
		add_filter( 'replace_editor', array( $this, 'redirect_to_recipe' ), 20, 2 );

		// Remove WordPress default publish box.
		add_action( 'admin_menu', array( $this, 'remove_publish_box' ) );
	}