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
/** | |
* Simple transformation to form data for uploading files | |
* using VueJS and Axios. | |
* | |
* Assuming that you pass your entire form as the `form` | |
* paramter. For example: | |
* | |
* data(){ | |
* return { | |
* form : { |
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
Amplitude.init({ | |
debug: true, | |
songs: [ | |
//Add songs here | |
], | |
callbacks: { | |
'time_update': function(){ | |
var currentTime = Amplitude.getSongPlayedSeconds(); |
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
function page_save( $post_id ){ | |
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; | |
if( isset( $_POST['pre-content-text'] ) ){ | |
update_post_meta( $post_id, 'pre-content-text', $_POST['pre-content-text'] ); | |
} | |
if( isset( $_POST['post-content-text'] ) ){ | |
update_post_meta( $post_id, 'post-content-text', $_POST['post-content-text'] ); | |
} |
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
function custom_meta_box_render(){ | |
global $post; | |
$custom_values = get_post_custom( $post->id ); | |
$pre_content_text = isset( $custom_values['pre-content-text'][0] ) ? $custom_values['pre-content-text'][0] : ''; | |
$post_content_text = isset( $custom_values['post-content-text'][0] ) ? $custom_values['post-content-text'][0] : ''; | |
?> | |
<label style="font-size: 15px;">Pre Content Text</label><br> |
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
<label style="font-size: 15px;">Pre Content Text</label><br> | |
<div style="margin-top: 20px;"> | |
<?php wp_editor($pre_content_text, 'pre-content-text', array() ); ?> | |
</div> | |
<label style="font-size: 15px;">Post Content Text</label><br> | |
<div style="margin-top: 20px;"> | |
<?php wp_editor($post_content_text, 'post-content-text', array() ); ?> | |
</div> |
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
<?php | |
add_action( 'add_meta_boxes', 'add_custom_meta_boxes'); | |
function add_custom_meta_boxes(){ | |
add_meta_box( | |
'my-meta-box', | |
'Example Meta Data', | |
'custom_meta_box_render', | |
'page', | |
'normal', | |
'high' |
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
[{"id":2,"label":"Test Tag","value":"Test Tag"}] |
NewerOlder