This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<BraveSelect class="me-3" v-model="selectValue" :options="options" dropdown-class="shadow rounded border list-group bg-white"> | |
<template v-slot:button="{ selectedValue }"> | |
<div role="button" class="btn btn-primary text-white px-3 d-flex "> | |
<div v-if="selectedValue!=null"> | |
<strong>{{ selectedValue.name }} </strong> is written in <strong> {{ selectedValue.language }}</strong> | |
</div> | |
<div v-else> | |
Select a Value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$post_type ="wf_account"; | |
// Add meta your meta field to the allowed values of the REST API orderby parameter | |
add_filter( | |
'rest_' . $post_type . '_collection_params', | |
function( $params ) { | |
$fields = ["first_name","last_name","address","email"]; | |
foreach ($fields as $key => $value) { | |
$params['orderby']['enum'][] = $value; | |
} | |
return $params; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( | |
'rest_' . $post_type . '_query', | |
function ( $args, $request ) { | |
$fields = ["first_name","last_name","address","email"]; | |
$order_by = $request->get_param( 'orderby' ); | |
if ( isset( $order_by ) && in_array($order_by, $fields)) { | |
$args['meta_key'] = $order_by; | |
$args['orderby'] = 'meta_value'; // user 'meta_value_num' for numerical fields | |
} | |
return $args; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'rest_api_init', 'addOrderbySupportRest' ); | |
function addOrderbySupportRest(){ | |
$post_type ="wf_account"; | |
// Add meta your meta field to the allowed values of the REST API orderby parameter | |
add_filter( | |
'rest_' . $post_type . '_collection_params', | |
function( $params ) { | |
$fields = ["first_name","last_name","address","email"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'rest_api_init', 'rest_api_filter_add_filters' ); | |
/** | |
* Add the necessary filter to each post type | |
**/ | |
function rest_api_filter_add_filters() { | |
foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { | |
add_filter( 'rest_' . $post_type->name . '_query', 'rest_api_filter_add_filter_param', 10, 2 ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style lang="scss"> | |
$card-border-radius:.95rem; | |
$card-bg:rgba(248,246,242,.3); | |
$border-radius: .45rem !default; | |
$border-radius-sm: .3rem !default; | |
$border-radius-lg: .4rem !default; | |
@import url(https://fonts.googleapis.com/css?family=Poppins:200,300,400,700); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
publicPath: './', | |
filenameHashing :false} |