add shelf item taxonomy and display on profile. include latest acf json.
This commit is contained in:
parent
4b7de4da3f
commit
7bdbc2b01d
4 changed files with 234 additions and 113 deletions
|
@ -41,7 +41,7 @@
|
|||
"key": "field_5c815af4df648",
|
||||
"label": "Tagline",
|
||||
"name": "tagline",
|
||||
"type": "text",
|
||||
"type": "textarea",
|
||||
"instructions": "This should be a short sentence about you. Followed by a phrase such as: `I was a mormon`.\r\n\r\nFor example: I enjoy camping and meditation, I am a traveller and truth-seeker. I was a mormon.",
|
||||
"required": 1,
|
||||
"conditional_logic": 0,
|
||||
|
@ -50,11 +50,11 @@
|
|||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"default_value": "I was a mormon.",
|
||||
"placeholder": "... I was a mormon.",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
"maxlength": "",
|
||||
"rows": 2,
|
||||
"new_lines": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5c815b7edf64a",
|
||||
|
@ -81,11 +81,11 @@
|
|||
"mime_types": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5c87a1f5c2b0c",
|
||||
"label": "Location",
|
||||
"name": "location",
|
||||
"type": "text",
|
||||
"instructions": "If you are comfortable, share where you live. Nothing specific, just a city or region.",
|
||||
"key": "field_5e8f9a6211bed",
|
||||
"label": "Story",
|
||||
"name": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
|
@ -93,18 +93,15 @@
|
|||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5c87b7a994494",
|
||||
"label": "About Me",
|
||||
"name": "about_me",
|
||||
"type": "textarea",
|
||||
"instructions": "Describe your background within a mormon context.",
|
||||
"instructions": "Share your background (be sure to include a mormon context).",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
|
@ -115,7 +112,7 @@
|
|||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"maxlength": "",
|
||||
"rows": 6,
|
||||
"rows": 10,
|
||||
"new_lines": "wpautop"
|
||||
},
|
||||
{
|
||||
|
@ -134,7 +131,7 @@
|
|||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"maxlength": "",
|
||||
"rows": 6,
|
||||
"rows": 10,
|
||||
"new_lines": "wpautop"
|
||||
},
|
||||
{
|
||||
|
@ -154,7 +151,7 @@
|
|||
"min": 0,
|
||||
"max": 0,
|
||||
"layout": "block",
|
||||
"button_label": "Add Question",
|
||||
"button_label": "Answer Another Question",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_5c82b49f902da",
|
||||
|
@ -194,11 +191,172 @@
|
|||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"maxlength": "",
|
||||
"rows": 5,
|
||||
"rows": 10,
|
||||
"new_lines": "wpautop"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_5ebaf40db15f2",
|
||||
"label": "Tags",
|
||||
"name": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5ebaf36bcc0fe",
|
||||
"label": "Mormon spectrum",
|
||||
"name": "mormon_spectrum",
|
||||
"type": "taxonomy",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"taxonomy": "spectrum",
|
||||
"field_type": "multi_select",
|
||||
"allow_null": 1,
|
||||
"add_term": 1,
|
||||
"save_terms": 0,
|
||||
"load_terms": 0,
|
||||
"return_format": "object",
|
||||
"multiple": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5ebaf423b15f3",
|
||||
"label": "On My Shelf",
|
||||
"name": "my_shelf",
|
||||
"type": "taxonomy",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"taxonomy": "shelf",
|
||||
"field_type": "multi_select",
|
||||
"allow_null": 1,
|
||||
"add_term": 1,
|
||||
"save_terms": 0,
|
||||
"load_terms": 0,
|
||||
"return_format": "object",
|
||||
"multiple": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5cb48fbcb16dc",
|
||||
"label": "Settings",
|
||||
"name": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5cb486045a336",
|
||||
"label": "Display Name",
|
||||
"name": "display_name",
|
||||
"type": "text",
|
||||
"instructions": "This is the name used along with your photo on various places in the site such as the directory. It's nice to match the with your name used in your introduction.",
|
||||
"required": 1,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5cb486165a337",
|
||||
"label": "Profile Id",
|
||||
"name": "profile_id",
|
||||
"type": "text",
|
||||
"instructions": "This will be your unique url. It must only contain url safe characters (uppercase and lowercase letters, numbers as well as a dash - and underscore _ are allowed). Example: firstname-lastname or reddit_username. This must also be unique, so if there is another 'bob-smith' you cannot use the same, and it will automatically update to 'bob-smith-2'. Note that changing this will break any external links to your current profile.",
|
||||
"required": 1,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5c815bccdf64c",
|
||||
"label": "Include me in the directory?",
|
||||
"name": "in_directory",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"false": "Not at all",
|
||||
"private": "Yes, but only to users who are logged in",
|
||||
"true": "Yes display my profile in the public directory"
|
||||
},
|
||||
"default_value": [
|
||||
"true"
|
||||
],
|
||||
"allow_null": 0,
|
||||
"multiple": 0,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"return_format": "value",
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5c87a1f5c2b0c",
|
||||
"label": "Location",
|
||||
"name": "location",
|
||||
"type": "text",
|
||||
"instructions": "If you are comfortable, share where you live. Nothing specific, just a city or region.",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5c86dea246f81",
|
||||
"label": "Links",
|
||||
|
@ -297,87 +455,11 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"key": "field_5cadf1eccb472",
|
||||
"label": "Spectrum",
|
||||
"name": "spectrum",
|
||||
"type": "taxonomy",
|
||||
"instructions": "Where are you on the spectrum? (add more as needed)",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"taxonomy": "spectrum",
|
||||
"field_type": "multi_select",
|
||||
"allow_null": 0,
|
||||
"add_term": 1,
|
||||
"save_terms": 1,
|
||||
"load_terms": 1,
|
||||
"return_format": "object",
|
||||
"multiple": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5cb48fbcb16dc",
|
||||
"label": "Settings",
|
||||
"name": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_5cb486045a336",
|
||||
"label": "Display Name",
|
||||
"name": "display_name",
|
||||
"type": "text",
|
||||
"instructions": "This is the name used along with your photo on various places in the site such as the directory. It's nice to match the with your name used in your introduction.",
|
||||
"required": 1,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5cb486165a337",
|
||||
"label": "Profile Id",
|
||||
"name": "profile_id",
|
||||
"type": "text",
|
||||
"instructions": "This will be your unique url. It must only contain url safe characters (uppercase and lowercase letters, numbers as well as a dash - and underscore _ are allowed). Example: firstname-lastname or reddit_username. This must also be unique, so if there is another 'bob-smith' you cannot use the same, and it will automatically update to 'bob-smith-2'. Note that changing this will break any external links to your current profile.",
|
||||
"required": 1,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": "",
|
||||
"maxlength": ""
|
||||
},
|
||||
{
|
||||
"key": "field_5c815bccdf64c",
|
||||
"label": "Include me in the directory?",
|
||||
"name": "in_directory",
|
||||
"key": "field_5e428267bd07d",
|
||||
"label": "I want to write posts",
|
||||
"name": "i_want_to_write_posts",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"instructions": "Do you want to contribute blog posts to wasmormon.org?",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
|
@ -386,13 +468,11 @@
|
|||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"false": "Not at all",
|
||||
"private": "Yes, but only to users who are logged in",
|
||||
"true": "Yes display my profile in the public directory"
|
||||
"No thanks": "No thanks",
|
||||
"Maybe": "Maybe",
|
||||
"Yes, please": "Yes, please"
|
||||
},
|
||||
"default_value": [
|
||||
"true"
|
||||
],
|
||||
"default_value": [],
|
||||
"allow_null": 0,
|
||||
"multiple": 0,
|
||||
"ui": 1,
|
||||
|
@ -433,5 +513,5 @@
|
|||
],
|
||||
"active": 1,
|
||||
"description": "",
|
||||
"modified": 1555343173
|
||||
"modified": 1589310533
|
||||
}
|
|
@ -59,7 +59,6 @@ function wasmo_hide_admin_bar() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function cptui_register_my_taxes() {
|
||||
|
||||
/**
|
||||
|
@ -122,8 +121,36 @@ function cptui_register_my_taxes() {
|
|||
"rest_base" => "spectrum",
|
||||
"rest_controller_class" => "WP_REST_Terms_Controller",
|
||||
"show_in_quick_edit" => false,
|
||||
);
|
||||
);
|
||||
register_taxonomy( "spectrum", array( "post", "user" ), $args );
|
||||
|
||||
/**
|
||||
* Taxonomy: Shelf Items.
|
||||
*/
|
||||
|
||||
$labels = array(
|
||||
"name" => __( "Shelf Items", "wasmo" ),
|
||||
"singular_name" => __( "Shelf Item", "wasmo" ),
|
||||
);
|
||||
|
||||
$args = array(
|
||||
"label" => __( "Shelf Items", "wasmo" ),
|
||||
"labels" => $labels,
|
||||
"public" => true,
|
||||
"publicly_queryable" => true,
|
||||
"hierarchical" => false,
|
||||
"show_ui" => true,
|
||||
"show_in_menu" => true,
|
||||
"show_in_nav_menus" => true,
|
||||
"query_var" => true,
|
||||
"rewrite" => array( 'slug' => 'shelf', 'with_front' => true, ),
|
||||
"show_admin_column" => false,
|
||||
"show_in_rest" => true,
|
||||
"rest_base" => "shelf",
|
||||
"rest_controller_class" => "WP_REST_Terms_Controller",
|
||||
"show_in_quick_edit" => false,
|
||||
);
|
||||
register_taxonomy( "shelf", array( "post", "user" ), $args );
|
||||
}
|
||||
add_action( 'init', 'cptui_register_my_taxes' );
|
||||
|
||||
|
@ -452,7 +479,7 @@ function wasmo_send_admin_email__profile_update( $user_id, $save_count ){
|
|||
if ( $save_count > 1 ) {
|
||||
$notify_mail_message .= 'Profile updated ';
|
||||
}
|
||||
$notify_mail_message .= 'by ' . $user_nicename.': ' . get_author_posts_url( $user_id );
|
||||
$notify_mail_message .= 'by ' . $user_nicename .': ' . get_author_posts_url( $user_id );
|
||||
// send mail
|
||||
wp_mail( $notify_mail_to, $notify_mail_subject, esc_html( $notify_mail_message ), $headers );
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Author: Evan Mullins
|
||||
Author URI: https://circlecube.com
|
||||
Template: twentynineteen
|
||||
Version: 1.7.8
|
||||
Version: 1.8.0
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: wasmo
|
||||
|
|
|
@ -83,13 +83,26 @@
|
|||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$spectrum_terms = get_field( 'spectrum', 'user_' . $userid );
|
||||
$shelf_items = get_field( 'my_shelf', 'user_' . $userid );
|
||||
if ( $shelf_items ) { ?>
|
||||
<h4>On my shelf</h4>
|
||||
<ul class="tags">
|
||||
<?php foreach( $shelf_items as $term ): ?>
|
||||
<li><span class="tag"><?php echo $term->name; ?></span></li>
|
||||
<!-- <li><a class="tag" href="<?php echo get_term_link( $term ); ?>"><?php echo $term->name; ?></a></li> -->
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php }
|
||||
?>
|
||||
|
||||
<?php
|
||||
$spectrum_terms = get_field( 'mormon_spectrum', 'user_' . $userid );
|
||||
if ( $spectrum_terms ) { ?>
|
||||
<h4>On the Mormon Spectrum</h4>
|
||||
<ul class="tags">
|
||||
<?php foreach( $spectrum_terms as $term ): ?>
|
||||
<li><span class="tag"><?php echo $term->name; ?></span></li>
|
||||
<?php /* <a href="<?php echo get_term_link( $term ); ?>">View all '<?php echo $term->name; ?>' posts</a> */ ?>
|
||||
<!-- <li><a class="tag" href="<?php echo get_term_link( $term ); ?>"><?php echo $term->name; ?></a></li> -->
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php }
|
||||
|
@ -116,6 +129,7 @@ if( have_rows( 'questions', 'user_' . $userid ) ):
|
|||
$termtaxid = get_sub_field( 'question', 'users_' . $userid );
|
||||
$questionterm = get_term( $termtaxid, 'question' );
|
||||
echo wp_kses_post( $questionterm->name );
|
||||
echo ' <a href="' . get_term_link( $termtaxid, 'question' ) . '" class="question_link_inline">' . twentynineteen_get_icon_svg( 'link', 20 ) . '</a>';
|
||||
echo '</h4>';
|
||||
echo wp_kses_post( get_sub_field( 'answer', 'users_' . $userid ) );
|
||||
|
||||
|
|
Loading…
Reference in a new issue