INVP::get_meta( string $unprefixed_meta_key, int $post_ID = null )
get_meta
Parameters #Parameters
- $unprefixed_meta_key
-
(string) (Required)
- $post_ID
-
(int) (Optional)
Default value: null
Return #Return
(string|int|double|array)
Source #Source
File: includes/class-invp.php
public static function get_meta( $unprefixed_meta_key, $post_ID = null ) { if ( empty( $post_ID ) ) { $post_ID = get_the_ID(); } $meta_key = apply_filters( 'invp_prefix_meta_key', $unprefixed_meta_key ); // Options are stored as a multi-valued meta field $single = $unprefixed_meta_key != 'options_array'; $meta_value = get_post_meta( $post_ID, $meta_key, $single ); // If the meta key is a number, return a number, and zero instead of empty string if ( self::meta_value_is_number( $meta_key ) ) { if ( empty( $meta_value ) ) { return 0; } if ( false === strpos( $meta_value, '.' ) ) { return (int) $meta_value; } return (float) $meta_value; } return $meta_value; }
Expand full source code Collapse full source code View on Github
Related #Related
Uses #Uses
Uses | Description |
---|---|
includes/class-invp.php: INVP::meta_value_is_number() |
meta_value_is_number |
inventory-presser.php: invp_prefix_meta_key |
Determine if this meta field should be sorted as a number 1. Parse out the meta key name from $pieces[‘where’] 2. Run it through INVP::meta_value_is_number |
Used By #Used By
Used By | Description |
---|---|
includes/template-tags.php: invp_is_carfax_one_owner() |
Answers the question, “is this vehicle designated a “one owner” by Carfax? |
includes/template-tags.php: invp_is_certified_preowned() |
Answers the question, “is this vehicle certified pre-owned?” |
includes/template-tags.php: invp_is_featured() |
Is this vehicle featured in slideshows? |
includes/template-tags.php: invp_is_sold() |
Returns true if this vehicle is sold. |
includes/template-tags.php: invp_is_wholesale() |
Returns true if this vehicle is marked wholesale. |
includes/template-tags.php: invp_get_the_year() |
invp_get_the_year |
includes/template-tags.php: invp_get_the_youtube_url() |
invp_get_the_youtube_url |
includes/template-tags.php: invp_have_carfax_report() |
invp_have_carfax_report |
includes/template-tags.php: invp_get_the_stock_number() |
invp_get_the_stock_number |
includes/template-tags.php: invp_get_the_title_status() |
invp_get_the_title_status |
includes/template-tags.php: invp_get_the_transmission() |
invp_get_the_transmission |
includes/template-tags.php: invp_get_the_transmission_speeds() |
invp_get_the_transmission_speeds |
includes/template-tags.php: invp_get_the_trim() |
invp_get_the_trim |
includes/template-tags.php: invp_get_the_type() |
invp_get_the_type |
includes/template-tags.php: invp_get_the_VIN() |
Template tag. Returns the vehicles VIN. |
includes/template-tags.php: invp_get_the_price() |
invp_get_the_price |
includes/template-tags.php: invp_get_the_msrp() |
invp_get_the_msrp |
includes/template-tags.php: invp_get_the_odometer() |
Template tag. Returns the odometer formatted as a number with comma separators if it is numeric. Returns any other non-zero value without any formatting. Adds the $append value to any return value but an empty string. |
includes/template-tags.php: invp_get_the_options() |
invp_get_the_options |
includes/template-tags.php: invp_get_the_payment() |
invp_get_the_payment |
includes/template-tags.php: invp_get_the_payment_frequency() |
invp_get_the_payment_frequency |
includes/template-tags.php: invp_get_raw_price() |
invp_get_raw_price |
includes/template-tags.php: invp_get_the_make() |
invp_get_the_make |
includes/template-tags.php: invp_get_the_model() |
invp_get_the_model |
includes/template-tags.php: invp_get_raw_msrp() |
invp_get_raw_msrp |
includes/template-tags.php: invp_get_raw_last_modified() |
invp_get_raw_last_modified |
includes/template-tags.php: invp_get_the_length() |
invp_get_the_length |
includes/template-tags.php: invp_get_the_down_payment() |
invp_get_the_down_payment |
includes/template-tags.php: invp_get_the_drive_type() |
invp_get_the_drive_type |
includes/template-tags.php: invp_get_the_edmunds_style_id() |
invp_get_the_edmunds_style_id |
includes/template-tags.php: invp_get_the_engine() |
invp_get_the_engine |
includes/template-tags.php: invp_get_the_fuel() |
invp_get_the_fuel |
includes/template-tags.php: invp_get_the_fuel_economy_value() |
invp_get_the_fuel_economy_value |
includes/template-tags.php: invp_get_the_hull_material() |
invp_get_the_hull_material |
includes/template-tags.php: invp_get_the_interior_color() |
invp_get_the_interior_color |
includes/template-tags.php: invp_get_the_description() |
invp_get_the_description |
includes/template-tags.php: invp_get_the_doors() |
invp_get_the_doors |
includes/template-tags.php: invp_get_the_beam() |
invp_get_the_beam |
includes/template-tags.php: invp_get_the_body_style() |
invp_get_the_body_style |
includes/template-tags.php: invp_get_raw_book_value() |
invp_get_raw_book_value |
includes/template-tags.php: invp_get_the_carfax_url_svg() |
invp_get_the_carfax_url_svg |
includes/template-tags.php: invp_get_the_carfax_url_report() |
invp_get_the_carfax_url_report |
includes/template-tags.php: invp_get_the_color() |
invp_get_the_color |
includes/template-tags.php: invp_get_the_dealer_id() |
invp_get_the_dealer_id |
includes/template-tags.php: invp_get_the_availability() |
invp_get_the_availability |
includes/integrations/class-contact-form-7.php: Inventory_Presser_Contact_Form_7::add_mail_tags() | |
includes/admin/class-admin-photo-arranger.php: Inventory_Presser_Admin_Photo_Arranger::change_parents_and_sequence() |
Runs on edit_post hook. Changes the post_parent values on photos in our magic Gallery block. |
includes/shortcode/class-shortcode-attribute-table.php: Inventory_Presser_Shortcode_Attribute_Table::content() | |
includes/admin/class-admin-customize-dashboard.php: Inventory_Presser_Admin_Customize_Dashboard::save_vehicle_post_meta() |
save_vehicle_post_meta |
includes/admin/class-admin-customize-dashboard.php: Inventory_Presser_Admin_Customize_Dashboard::meta_box_html_featured() |
meta_box_html_featured |
includes/admin/class-admin-customize-dashboard.php: Inventory_Presser_Admin_Customize_Dashboard::meta_box_html_prices() |
meta_box_html_prices |
includes/class-photo-numberer.php: Inventory_Presser_Photo_Numberer::add_sequence_number_to_titles() | |
includes/class-photo-numberer.php: Inventory_Presser_Photo_Numberer::save_meta_photo_number() |
save_meta_photo_number |
includes/class-badges.php: Inventory_Presser_Badges::add_nextgear() | |
inventory-presser.php: Inventory_Presser_Plugin::change_attachment_urls() |
Adds a querystring to vehicle attachment photo URLs to fight caching. |
includes/class-template-provider.php: Inventory_Presser_Template_Provider::lie_about_post_thumbnails() |
lie_about_post_thumbnails |