$ rails g model User
belongs_to
has_one
| <?php | |
| // source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy | |
| // code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup | |
| // CREATE CUSTOM TAXONOMY | |
| add_action( 'init', '___create_my_custom_tax' ); |
| <? | |
| /** | |
| * Repeatable Custom Fields in a Metabox | |
| * Author: Helen Hou-Sandi | |
| * | |
| * From a bespoke system, so currently not modular - will fix soon | |
| * Note that this particular metadata is saved as one multidimensional array (serialized) | |
| */ | |
| function hhs_get_sample_options() { |
| ( function( blocks, element ) { | |
| var el = element.createElement; | |
| function Stars( { stars } ) { | |
| return el( 'div', { key: 'stars' }, | |
| '★'.repeat( stars ), | |
| ( ( stars * 2 ) % 2 ) ? '½' : '' ); | |
| } | |
| blocks.registerBlockType( 'stars/stars-block', { |
apt install php7.2-common php7.2-cli php7.2-zip php7.2-opcache php7.2-mysql php7.2-mcrypt php7.2-mbstring php7.2-json php7.2-intl php7.2-gd php7.2-fpm php7.2-curl php7.2-bz2Copy the php7.2-fpm pool configuration from php7.0-fpm
cp -f /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.2/fpm/pool.d/www.conf| <?php | |
| // Event taxonomies | |
| add_action( 'init', function() { | |
| $labels = array( | |
| 'name' => _x( 'Terms', 'taxonomy general name' ), | |
| 'singular_name' => _x( 'Term', 'taxonomy singular name' ), | |
| ); | |
| register_taxonomy( 'taxonomy_name', array( 'post' ), array( | |
| 'hierarchical' => false, |
| (function(window) { | |
| 'use strict'; | |
| var toggleEvent = function(el, name, fn, unbind) { | |
| var methodName = (unbind ? 'remove' : 'add') + 'EventListener'; | |
| el[methodName](name, fn, false); | |
| }; | |
| <?php | |
| /** | |
| * Generates the markup for the 'Review' schema type in the JSON+LD format. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param int $review_id The post ID of the current review. | |
| * | |
| * @return string |