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( 'acf/save_post', 'my_acf_save_post_test' ); | |
function my_acf_save_post_test( $post_id ) { | |
if ( 'post' == get_post_type( $post_id ) ) { | |
$my_related_pages = get_field( 'my_related_page', $post_id, false ); | |
error_log(json_encode($my_related_pages)); | |
foreach ( $my_related_pages as $page ) { | |
// selected page | |
$related_posts = get_field( 'my_related_post', $page, false ); | |
if(!$related_posts){ | |
update_field( 'my_related_post', array($post_id), $page ); |
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_filter('acf/fields/user/result', 'my_acf_fields_post_object_result', 10, 4); | |
function my_acf_fields_post_object_result( $text, $user, $field, $post_id ) { | |
$text .= ' (' . $user->user_email . ')'; | |
return $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 register_custom_fields() { | |
$fieldArray = []; | |
array_push($fieldArray, | |
array( | |
'key' => 'sample_field_onee', | |
'label' => 'Sample Field', | |
'type' => '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
<?php | |
$current_date = date( 'md' ); // first load the current date into a variable, formatted as md | |
$employee_birthdays = new WP_Query( | |
array( | |
'posts_per_page' => -1, | |
'post_type' => 'member', // employee | |
'meta_query' => array( | |
array( | |
'key' => 'birthday', // assumes the date picker field is called birthday. Stored in Ymd format. |
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
/* package whatever; // don't place package name! */ | |
import java.io.*; | |
public class myCode | |
{ | |
public static void main(String[] args) throws java.lang.Exception | |
{ | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
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
/* package whatever; // don't place package name! */ | |
import java.io.*; | |
public class myCode | |
{ | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String input = br.readLine(); |
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
// Online Java Compiler | |
// Use this editor to write, compile and run your Java code online | |
import java.util.Scanner; | |
class HelloWorld { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); // Reading from System.in | |
//Enter the number of items to input | |
System.out.println("Enter a number: "); |
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($){ | |
/** | |
* initializeBlock | |
* | |
* Adds custom JavaScript to the block HTML. | |
* | |
* @date 15/4/19 | |
* @since 1.0.0 | |
* |
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 | |
/** | |
* Testimonial Block Template. | |
* | |
* @param array $block The block settings and attributes. | |
* @param string $content The block inner HTML (empty). | |
* @param bool $is_preview True during AJAX preview. | |
* @param (int|string) $post_id The post ID this block is saved to. | |
*/ |
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 | |
/** | |
* Newton Block Template. | |
* | |
* @param array $block The block settings and attributes. | |
* @param string $content The block inner HTML (empty). | |
* @param bool $is_preview True during AJAX preview. | |
* @param (int|string) $post_id The post ID this block is saved to. | |
*/ |
NewerOlder