brew install zsh
echo $(which zsh) | sudo tee -a /etc/shells
sudo chsh -s $(which zsh) $USER
Adding @k1sul1's suggestion from the comments as it's more concise than what I had before:
I just wanted them all gone, so I ran this in the MySQL shell.
UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, "\\[\/?vc(.*?)\]", "");
OR You can also do with with WP-CLI:
wp search-replace --regex --verbose "\\[\/?vc(.*?)\]" "" wp_posts
| <?php | |
| namespace JensSogaard; | |
| class BlockHelper | |
| { | |
| /** | |
| * Gets ACF fields for a specific block on a given post | |
| * @author Jens Soegaard <[email protected]> | |
| */ | |
| public function getBlockFromPage(string $block_id, int $post_id) |
As of WordPress 5.8 release, we encourage using block.json file metadata as the canonical way to register block types. We have been working on Block Metadata specification for a few major WordPress releases, and we reached the point where all planned features are in place.
Example:
notice/block.json
{
"apiVersion": 2,We have reached the first WordPress core release where the post editor is no longer the only screen that uses the block editor. In the middle of the development process, we found out that several WordPress hooks defined on the server depended on the $post object that isn’t present on the updated screen that lets users edit widgets using blocks. Therefore, we decided to deprecate some of the existing filters and introduce their context-aware replacements. This way, we ensure that we can continue iteratively enabling the block-based paradigm on different screens like the navigation editor screen by leveraging the new WP_Block_Editor_Context class that will receive more capabilities over time. There are also new methods introduced that allow code reuse for the functionality that needs to be shared between the screen that uses the block editor.
Related Trac ticket: #52920.
| { | |
| "title": "JSON schema for WordPress blocks", | |
| "$schema": "http://json-schema.org/draft-04/schema#", | |
| "definitions": { | |
| "//": { | |
| "reference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/", | |
| "attributesReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/", | |
| "contextReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-context/", | |
| "supportsReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/", | |
| "registerReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/#example-optional" |
| <?php | |
| /* Customiser script */ | |
| add_action( 'customize_register', 'custom_editor' ); | |
| function custom_editor( $wp_customize ) { | |
| // Analytics section | |
| $wp_customize->add_section('analytics_section', array( | |
| 'title' => __( 'Analytics', 'tuesday' ), | |
| 'description' => __( 'Enable tracking and analytics by placing your script tags in the correct location. <small><strong>Note:</strong> All scripts must be self-containing <script></script>, otherwise they will just print the code onto the website.</small>', 'tuesday' ), |
A list of useful commands for the ffmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| // https://deluxeblogtips.com/remove-dashboard-widgets-in-wordpress/ | |
| add_action('admin_init', 'rw_remove_dashboard_widgets'); | |
| function rw_remove_dashboard_widgets() { | |
| remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); // right now | |
| remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // recent comments | |
| remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // incoming links | |
| remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // plugins | |
| remove_meta_box('dashboard_quick_press', 'dashboard', 'normal'); // quick press | |
| remove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal'); // recent drafts |
| <?php | |
| /** | |
| * Returns a specified ACF field from a parent block | |
| * @param string $child_id The ID of the child ACF block | |
| * @param string $child_name The name of the child ACF block | |
| * @param string $parent_name The name of the parent ACF block | |
| * @param string $field The name of the parent's custom field to return | |
| * @param boolean $return_first If $field is an array, optionally return the first item. | |
| */ | |
| function get_field_from_parent($child_id, $child_name, $parent_name, $field, $return_first = false) { |