Remove html id and pass arguments to React components.
See original version for more information.
<?php | |
const POST_TYPE_NAME = 'YOUR_TYPE'; | |
/** | |
* Use Classic Editor for this post type. | |
*/ | |
add_filter( 'use_block_editor_for_post_type', fn( $result, $post_type_name ) => POST_TYPE_NAME === $post_type_name ? false : $result, 10, 2 ); |
Remove html id and pass arguments to React components.
See original version for more information.
Add apache setting.
HOST="your-host.example.com"; FORWARD_URL="http://127.0.0.1:10080/"
sudo tee -a /etc/apache2/sites-enabled/$HOST.conf <<EOT
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / $FORWARD_URL
ProxyPassReverse / $FORWARD_URL
sudo tee /lib/systemd/system/vpnserver.service << END | |
[Unit] | |
Description=SoftEther VPN Server | |
After=network.target | |
[Service] | |
Type=forking | |
Environment="TAP=tap_vpn" | |
Environment="BR=br0" | |
ExecStartPre=ip tuntap add \$TAP mode tap | |
ExecStartPre=ip link set \$TAP up |
<?php | |
/** | |
* Spoofing host and port for WordPress environment. | |
* To use this, include from your "wp-config.php" file. | |
* Note that this functions is not intended to be used in production. | |
* | |
* @see \is_ssl() | |
* @link https://ngrok.com/docs/using-ngrok-with/wordpress/ | |
*/ |
<?php | |
/** | |
* Class GdriveFolderViewer | |
* | |
* @see https://github.com/nao-pon/flysystem-google-drive#usage-to-with-elfinder | |
* composer require nao-pon/elfinder-flysystem-driver-ext nao-pon/flysystem-google-drive:~1.1 | |
* | |
*/ | |
class GdriveFolderViewer { |
<?php | |
/** | |
* Description: WooCommerce: Add stock filter function to builtin shortcodes. | |
* Author: chrono-meter@gmx.net | |
* Version: v20200727 | |
* | |
* @link https://docs.woocommerce.com/document/woocommerce-shortcodes/ | |
* | |
* Example: | |
* [products stock="instock"] |
<?php | |
/** | |
* CMB2 delete value instead of saving empty value. So fields with default value cannot hold empty value. | |
* This example works around this issue by adding new field parameter `initial value'. | |
* | |
* Example: | |
* $cmb->add_field( array( | |
* 'name' => 'Title for publish', | |
* 'initial_value' => '%d product(s) published', |
<?php | |
/** | |
* Plugin Name: CMB2 option test | |
* Author: chrono-meter@gmx.net | |
* Version: 20211223 | |
* | |
* @link https://github.com/CMB2/CMB2-Snippet-Library/search?q=object_types&unscoped_q=object_types | |
* @see add_menu_page() | |
* | |
* to get variables: cmb2_get_option('myprefix_network_options', 'key', 'default') |
<?php | |
/** | |
* Thumbnail images in search results | |
* | |
* @see https://support.google.com/customsearch/answer/1626955 | |
*/ | |
add_action( 'wp_head', function() { | |
if ( is_single() && '' !== ($thumbnail_id = get_post_thumbnail_id()) && false !== ($image = wp_get_attachment_image_src( $thumbnail_id ))) { | |
echo "<meta name=\"thumbnail\" content=\"{$image[0]}\">"; |