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
// Register a Custom Field - Add to your theme's functions.php or a custom plugin. | |
function register_now_playing_meta() { | |
// Slug: now_playing | |
register_meta( 'post', 'now_playing', array( | |
'type' => 'string', | |
'single' => true, | |
'show_in_rest' => true, // Makes the field available to the Block Editor. | |
'sanitize_callback' => 'sanitize_text_field', // Sanitized for better security. | |
)); | |
} |
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
/* Styles for the File List block */ | |
ul.my-file-list-block { | |
margin: 2em 0; | |
} | |
ul.my-file-list-block li { | |
border-bottom: 1px solid #495D0F; | |
padding: 10px 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 | |
/** | |
* Block template file: /blocks/file-list/file-list.php | |
* | |
* File List 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
{ | |
"name": "acf/file-list", | |
"title": "File List", | |
"description": "Display a list of documents for downloading.", | |
"style": [ "file:./block-styles.css" ], | |
"category": "formatting", | |
"icon": "media-document", | |
"keywords": ["document", "download", "list"], | |
"acf": { | |
"mode": "edit", |
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
/* Register Custom Blocks */ | |
function my_acf_custom_blocks_register() { | |
/** | |
* We register our block's with WordPress's handy | |
* register_block_type(); | |
* | |
* @link https://developer.wordpress.org/reference/functions/register_block_type/ | |
*/ | |
register_block_type( __DIR__ . '/blocks/file-list' ); // File List Block | |
} |
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
{ | |
"key": "group_5cf655a17ba10", | |
"title": "File Listing", | |
"fields": [ | |
{ | |
"key": "field_5cf655b709906", | |
"label": "Custom File List", | |
"name": "", | |
"type": "message", | |
"instructions": "", |
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
To create a MySQL query that retrieves users with a WooCommerce Customer ID and a membership via Restrict Content Pro, you will need to join several tables: `wp_users`, `wp_usermeta`, `wp_wc_customer_lookup`, and `wp_rcp_memberships`. | |
Here is the query to achieve this: | |
```sql | |
SELECT | |
u.ID AS user_id, | |
um_first_name.meta_value AS first_name, | |
um_last_name.meta_value AS last_name, | |
wc.customer_id, |
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
SELECT | |
u.ID AS user_id, | |
um_first_name.meta_value AS first_name, | |
um_last_name.meta_value AS last_name, | |
wc.customer_id, | |
rcp.status, | |
rcp.object_id | |
FROM | |
wp_users u | |
INNER JOIN |
NewerOlder