public static function find_one_by($property, $value)
    {
        global $wpdb;

        // Escape the value
        $value = esc_sql($value);

        // Get the table name
        $table = static::get_table();

        // Get the item
        $obj = $wpdb->get_row("SELECT * FROM `{$table}` WHERE `{$property}` = '{$value}'", ARRAY_A);

        // Return false if no item was found, or a new model
        return ($obj ? static::create($obj) : false);
    }
public static function find_one_by($property, $value)
    {
        global $wpdb;

        // Escape the value
        $value = esc_sql($value);

        // Get the table name
        $table = static::get_table();

        // Get the item
        $obj = $wpdb->get_row("SELECT * FROM `{$table}` WHERE `{$property}` = '{$value}'", ARRAY_A);

        // Return false if no item was found, or a new model
        return ($obj ? static::create($obj) : false);
    }
public static function find_one_by ( $ property , $ value ) { global $ wpdb ; // Escape the value $ value = esc_sql ( $ value ) ; // Get the table name $ table = static :: get_table ( ) ; // Get the item $ obj = $ wpdb -> get_row ( "SELECT * FROM `{$table}` WHERE `{$property}` = '{$value}'" , ARRAY_A ) ; // Return false if no item was found, or a new model return ( $ obj ? static :: create ( $ obj ) : false ) ; }
Find a specific model by a given property value.

@param  string $property
@param  string $value
@return false|self
Find a specific model by a given property value .