开发者 | Dave Liske |
---|---|
更新时间 | 2015年12月13日 20:40 |
PHP版本: | 2.8.6 及以上 |
WordPress版本: | 4.4 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
The content block will hold up to 64,000 characters.
Yes, just copy the PHP as normal into a content block without the <?php, <?, ?> tags and insert the block into your content as normal.
Yes, the Settings page where the content blocks are created includes the standard WordPress visual/HTML editor.
Simply add the shortcode within a block as normal, for example [gallery] to add a WordPress gallery.
Yes, just wrap it in the PHP function <?php echo gcb(x);?> where x is the content block ID. You can also use the longer form <?php do_shortcode("[contentblock id=x]");?>
If you look at the source code for your page you'll likely find something like this: < ! -- This site is optimized with the Yoast SEO plugin v3.0.3 - https: //yoast.com/wordpress/plugins/seo/ -- > < meta name="description" content="[contentblock id=hmn_yanagibas_oct] [contentblock id=17 img=gcb.png]"/ > What happens is that Facebook scrapes the meta description (or an og:description if you have that set up instead) and loads it as the description for their link. That's probably what you're seeing happen, especially since this is the only place the shortcodes appear when viewing the page source. This is a known issue with the Yoast SEO plugin, as described here: https://github.com/Yoast/wordpress-seo/issues/2846 Looking at their changelog, it appears the fix has not yet been implemented. If you're so inclined, the solution is also listed on the above linked page. I haven't tried it myself, so I can offer no guarantees. But this issue is definitely reproducable with the current version of the Yoast plugin installed.
Yes, you can add the filter 'gcb_block_output' to modify output by adding a PHP script to functions.php, for example: add_filter('gcb_block_output', 'alter_block_output'); function alter_block_output($value) { //process the output here, e.g., convert text to lowercase $new_value = strtolower($value); return "Processed output: ".$new_value; }
Yes, You can use variables within the content block that will be replaced when the block is displayed. For example, if you create a content block, say id=1 with: My name is %%name%% by using the shortcode [contentblock id=1 name="John Doe"] when displayed it will appear as My name is John Doe.
Yes, WordPress global variables can be used within content blocks, for example, global $user_login; global $user_email; echo "$user_login, you email is: $user_email"; would output the username and email of the current logged in user, e.g.,�John, your email is john@youremail.com.
No, the blocks are added to the WordPress database, so are independent of the theme and unaffected by WordPress upgrades.
Yes, there is an option to delete the database table if you want to completely remove the plugin.
Yes, an Import/Export function is included. Just Export form one site, install the plugin on the other site and import.