Inventory_Presser_Customize_Admin_Dashboard::meta_box_html_options( $post )


Source

File: includes/class-customize-admin-dashboard.php

		//Add a link to the main menu of the Admin bar
		add_action( 'admin_bar_menu', array( $this, 'add_vehicles_to_admin_bar' ), 100 );

		$options = INVP::settings();

		//If the Show All Taxonomies setting is checked, change the way we register taxonomies
		if( isset( $options['show_all_taxonomies'] ) && $options['show_all_taxonomies'] ) {
			add_filter( 'invp_taxonomy_data', array( $this, 'change_taxonomy_show_ui_attributes' ) );
		}

		//Change some messages in the dashboard the user sees when updating vehicles
		add_filter( 'post_updated_messages', array( $this, 'change_post_updated_messages' ) );
	}
	
	/**
	 * insert_settings_link
	 *
	 * Adds a link to the settings page near the Activate | Delete links on the
	 * list of plugins on the Plugins page.
	 * 
	 * @param  array $links
	 * @return array
	 */
	function insert_settings_link( $links )
	{
		$url = admin_url( sprintf( 
			'edit.php?post_type=%s&page=dealership-options',
			INVP::POST_TYPE
		) );
		$links[] = sprintf(
			'<a href="%s">%s</a>',
			$url,
			__( 'Settings', 'inventory-presser' )
		);
		return $links;
	}
	
	/**
	 * load_scripts
	 * 
	 * Includes JavaScripts and stylesheets that power our changes to the 
	 * dashboard. 
	 *
	 * @param  string $hook
	 * @return void
	 */
	function load_scripts( $hook )
	{
		wp_enqueue_style( 'my-admin-theme', plugins_url( '/css/wp-admin.min.css', INVP_PLUGIN_FILE_PATH ) );
		wp_register_script( 'inventory-presser-javascript', plugins_url( '/js/admin.min.js', INVP_PLUGIN_FILE_PATH ) );
		wp_enqueue_script( 'inventory-presser-javascript' );

		//localize an odometer units word for the edit vehicle page
		wp_localize_script( 'inventory-presser-javascript', 'invp', array(
			'hull_materials'      => apply_filters( 'invp_default_hull_materials', array(
				'Aluminum',
				'Carbon Fiber',
				'Composite',
				'Ferro-Cement',
				'Fiberglass',
				'Hypalon',
				'Other',
				'PVC',
				'Steel',
				'Wood',
			) ),
			'miles_word'          => apply_filters( 'invp_odometer_word', 'miles' ),
			'meta_prefix'         => INVP::meta_prefix(),
			'payment_frequencies' => apply_filters( 'invp_default_payment_frequencies', array(
				'Monthly'      => 'monthly',
				'Weekly'       => 'weekly',
				'Bi-weekly'    => 'biweekly',
				'Semi-monthly' => 'semimonthly',
			) ),
			'delete_all_media_nonce' => wp_create_nonce( self::NONCE_DELETE_ALL_MEDIA ),
		) );
	}
	
	/**
	 * make_vehicles_table_columns_sortable
	 * 
	 * Declares which of our custom columns on the list of posts are sortable.
	 *
	 * @param  array $columns
	 * @return array
	 */
	function make_vehicles_table_columns_sortable( $columns )
	{
		$custom = array(
			// meta column id => sortby value used in query
			apply_filters( 'invp_prefix_meta_key', 'color' )        => apply_filters( 'invp_prefix_meta_key', 'color' ),
			apply_filters( 'invp_prefix_meta_key', 'odometer' )     => apply_filters( 'invp_prefix_meta_key', 'odometer' ),
			apply_filters( 'invp_prefix_meta_key', 'price' )        => apply_filters( 'invp_prefix_meta_key', 'price' ),
			apply_filters( 'invp_prefix_meta_key', 'stock_number' ) => apply_filters( 'invp_prefix_meta_key', 'stock_number' ),
			apply_filters( 'invp_prefix_meta_key', 'photo_count' )  => apply_filters( 'invp_prefix_meta_key', 'photo_count' ),
			apply_filters( 'invp_prefix_meta_key', 'thumbnail' )    => apply_filters( 'invp_prefix_meta_key', 'thumbnail' ),
		);
		return wp_parse_args( $custom, $columns );
	}
	
	/**