Inventory_Presser_Admin_Customize_Dashboard::meta_box_html_options( WP_Post $post )
meta_box_html_options
Contents
Description Description
Creates a meta box to help the user see and manage vehicle options while editing a vehicle post.
Parameters Parameters
- $post
-
(WP_Post) (Required)
Return Return
(void)
Source Source
File: includes/admin/class-admin-customize-dashboard.php
function meta_box_html_options( $post ) { $options = apply_filters( 'invp_default_options', array( __( '3rd Row Seats', 'inventory-presser' ), __( 'Air Bags', 'inventory-presser' ), __( 'Air Conditioning', 'inventory-presser' ), __( 'Alloy Wheels', 'inventory-presser' ), __( 'Aluminum Wheels', 'inventory-presser' ), __( 'AM/FM Stereo', 'inventory-presser' ), __( 'Anti-lock Brakes', 'inventory-presser' ), __( 'Backup Camera', 'inventory-presser' ), __( 'Bed Cap', 'inventory-presser' ), __( 'Bluetooth, Hands Free', 'inventory-presser' ), __( 'Cassette', 'inventory-presser' ), __( 'CD Player', 'inventory-presser' ), __( 'Cell or Intergrated Cell Phone', 'inventory-presser' ), __( 'Cloth Seats', 'inventory-presser' ), __( 'Conversion Package', 'inventory-presser' ), __( 'Convertible', 'inventory-presser' ), __( 'Cooled Seats', 'inventory-presser' ), __( 'Cruise Control', 'inventory-presser' ), __( 'Custom Paint', 'inventory-presser' ), __( 'Disability Equipped', 'inventory-presser' ), __( 'Dual Sliding Doors', 'inventory-presser' ), __( 'DVD Player', 'inventory-presser' ), __( 'Extended Cab', 'inventory-presser' ), __( 'Fog Lights', 'inventory-presser' ), __( 'Heated Seats', 'inventory-presser' ), __( 'Keyless Entry', 'inventory-presser' ), __( 'Leather Seats', 'inventory-presser' ), __( 'Lift Kit', 'inventory-presser' ), __( 'Long Bed', 'inventory-presser' ), __( 'Memory Seat(s)', 'inventory-presser' ), __( 'Moon Roof', 'inventory-presser' ), __( 'Multi-zone Climate Control', 'inventory-presser' ), __( 'Navigation System', 'inventory-presser' ), __( 'Oversize Off Road Tires', 'inventory-presser' ), __( 'Portable Audio Connection', 'inventory-presser' ), __( 'Power Brakes', 'inventory-presser' ), __( 'Power Lift Gate', 'inventory-presser' ), __( 'Power Locks', 'inventory-presser' ), __( 'Power Seats', 'inventory-presser' ), __( 'Power Steering', 'inventory-presser' ), __( 'Power Windows', 'inventory-presser' ), __( 'Premium Audio', 'inventory-presser' ), __( 'Premium Wheels', 'inventory-presser' ), __( 'Privacy Glass', 'inventory-presser' ), __( 'Quad Seating', 'inventory-presser' ), __( 'Rear Air Bags', 'inventory-presser' ), __( 'Rear Air Conditioning', 'inventory-presser' ), __( 'Rear Defroster', 'inventory-presser' ), __( 'Rear Heat', 'inventory-presser' ), __( 'Refrigerator', 'inventory-presser' ), __( 'Roof Rack', 'inventory-presser' ), __( 'Running Boards', 'inventory-presser' ), __( 'Satellite Radio', 'inventory-presser' ), __( 'Security System', 'inventory-presser' ), __( 'Short Bed', 'inventory-presser' ), __( 'Side Air Bags', 'inventory-presser' ), __( 'Skid Plate(s)', 'inventory-presser' ), __( 'Snow Plow', 'inventory-presser' ), __( 'Spoiler', 'inventory-presser' ), __( 'Sport Package', 'inventory-presser' ), __( 'Step Side Bed', 'inventory-presser' ), __( 'Steering Wheel Controls', 'inventory-presser' ), __( 'Styled Steel Wheels', 'inventory-presser' ), __( 'Sunroof', 'inventory-presser' ), __( 'Supercharger', 'inventory-presser' ), __( 'Tilt Steering Wheel', 'inventory-presser' ), __( 'Tonneau Cover', 'inventory-presser' ), __( 'Topper', 'inventory-presser' ), __( 'Tow Package', 'inventory-presser' ), __( 'Traction Control', 'inventory-presser' ), __( 'Trailer Hitch', 'inventory-presser' ), __( 'Turbo', 'inventory-presser' ), __( 'Two Tone Paint', 'inventory-presser' ), __( 'Wheelchair Access', 'inventory-presser' ), __( 'Wide Tires', 'inventory-presser' ), __( 'Winch', 'inventory-presser' ), __( 'Wire Wheels', 'inventory-presser' ), __( 'Xenon Headlights', 'inventory-presser' ), ) ); // turn the array into an associative array with value false for all $options = array_fill_keys( $options, false ); $options_array = invp_get_the_options( $post->ID ); if ( is_array( $options_array ) ) { foreach ( $options_array as $option ) { $options[ $option ] = true; } } // sort the array by key ksort( $options ); // output a bunch of checkboxes $HTML = '<div class="list-with-columns"><ul class="optional-equipment">'; foreach ( $options as $key => $value ) { // element IDs cannot contain slashes, spaces or parentheses $id = 'option-' . preg_replace( '/\/\(\)/i', '', str_replace( ' ', '_', $key ) ); $HTML .= sprintf( '<li><input type="checkbox" id="%s" name="%s" value="%s"%s><label for="%s">%s</label></li>', $id, 'inventory_presser_options_array[]', $key, checked( true, $value, false ), $id, $key ); } echo $HTML . '</ul></div>'; }
Expand full source code Collapse full source code View on Github