Skip to content

Commit

Permalink
v1.4.3 of the plugin
Browse files Browse the repository at this point in the history
- Elementor v2.4.0 compat
- Enhancements for Block Editor support
- new template content types
- smaller tweaks and improvements
  • Loading branch information
deckerweb committed Jan 21, 2019
1 parent 2e28aab commit d54f3b3
Show file tree
Hide file tree
Showing 77 changed files with 1,883 additions and 1,020 deletions.
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [Plugin page on WordPress.org: wordpress.org/plugins/builder-template-categories/](https://wordpress.org/plugins/builder-template-categories/)
* [Translate the plugin](https://translate.wordpress.org/projects/wp-plugins/builder-template-categories)
* [**Join plugin's newsletter for insider info, tutorials and more**](https://eepurl.com/gbAUUn)
* [**Donate** for the further development & support of the plugin](https://www.paypal.me/deckerweb)
* [Plugin's documentation & FAQ](https://wordpress.org/plugins/builder-template-categories/#faq)
* [Facebook Community User Group](https://www.facebook.com/groups/deckerweb.wordpress.plugins/)
Expand All @@ -12,6 +13,17 @@

## Changelog of the Plugin

### 1.4.3 - 2019-01-21

* New: Additional checks for Block Editor (Gutenberg) integration if one of the popular disabling plugins has disabled it completely (in that case the integration won't be loaded at all!)
* New: Overhauled Elementor integration to be also fully compatible with Elementor 2.4.0 or higher (while still being compatible with older Elementor versions)
* New: Make predefined category terms also available for Elementor built-in "Categories" taxonomy (only for Elementor v2.4.0+)
* New: Added new template content types "Flow/ Flows" and "Snippet/ Snippets"
* New: [Join my newsletter for DECKERWEB WordPress Plugins](https://eepurl.com/gbAUUn) - insider info, plus tutorials and more useful stuff
* Tweak: Updated `.pot` file plus all German translations (formal, informal) and language packs
* Tweak: Enhanced and improved Readme.txt file here - also added new FAQ entry


### 1.4.2 - 2018-12-14

* Tweak: Moved admin CSS into proper stylesheet, and enqueue it - this fixes issues users have reported
Expand Down
253 changes: 146 additions & 107 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/btc-help.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@
padding: 5px 10px;
}

.btc.dashicons-thumbs-up:before {
.btc.dashicons-before:before {
margin-top: 2px;
}
38 changes: 24 additions & 14 deletions builder-template-categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Main plugin file.
* @package Builder Template Categories
* @author David Decker
* @copyright Copyright (c) 2018, David Decker - DECKERWEB
* @copyright Copyright (c) 2018-2019, David Decker - DECKERWEB
* @license GPL-2.0-or-later
* @link https://deckerweb.de/twitter
*
Expand All @@ -23,7 +23,7 @@
* GitHub Plugin URI: https://github.com/deckerweb/builder-template-categories
* GitHub Branch: master
*
* Copyright (c) 2018 David Decker - DECKERWEB
* Copyright (c) 2018-2019 David Decker - DECKERWEB
*/

/**
Expand Down Expand Up @@ -55,9 +55,9 @@
*
* @since 1.0.0
*
* @uses get_user_locale()
* @uses load_textdomain() To load translations first from WP_LANG_DIR sub folder.
* @uses load_plugin_textdomain() To additionally load default translations from plugin folder (default).
* @uses get_user_locale()
* @uses load_textdomain() To load translations first from WP_LANG_DIR sub folder.
* @uses load_plugin_textdomain() To additionally load default translations from plugin folder (default).
*/
function ddw_btc_load_translations() {

Expand Down Expand Up @@ -155,12 +155,13 @@ function ddw_btc_setup_plugin() {
* Steps of the plugin activation routine.
*
* @since 1.0.0
* @since 1.4.3 Predefined terms for Elementor's own taxonomy.
*
* @see includes/reguster-taxonomy.php
* @see plugin file includes/register-taxonomy.php
*
* @uses ddw_btc_load_translations()
* @uses ddw_btc_register_templates_taxonomy()
* @uses ddw_btc_add_predefined_terms()
* @uses ddw_btc_load_translations()
* @uses ddw_btc_register_templates_taxonomy()
* @uses ddw_btc_add_predefined_terms()
*/
function ddw_btc_plugin_activation_routine() {

Expand All @@ -180,9 +181,18 @@ function ddw_btc_plugin_activation_routine() {

ddw_btc_register_templates_taxonomy();

/** Add predefined terms */
if ( apply_filters( 'btc/filter/terms/add_predefined', TRUE ) ) {
ddw_btc_add_predefined_terms();
}

/** For our own taxonomy */
ddw_btc_add_predefined_terms( 'builder-template-category' );

/** Optionally for Elementor's built-in tax */
if ( ddw_btc_is_elementor_version( 'core', '2.4.0-beta1', '>=' ) ) {
ddw_btc_add_predefined_terms( 'elementor_library_category' );
}

} // end if

} // end function

Expand All @@ -194,9 +204,9 @@ function ddw_btc_plugin_activation_routine() {
*
* @since 1.0.0
*
* @link https://leaves-and-love.net/blog/making-plugin-multisite-compatible/
* @link https://leaves-and-love.net/blog/making-plugin-multisite-compatible/
*
* @uses ddw_btc_plugin_activation_routine()
* @uses ddw_btc_plugin_activation_routine()
*/
function ddw_btc_run_plugin_activation( $network_wide ) {

Expand Down Expand Up @@ -236,7 +246,7 @@ function ddw_btc_run_plugin_activation( $network_wide ) {
*
* @since 1.0.0
*
* @uses ddw_btc_plugin_activation_routine()
* @uses ddw_btc_plugin_activation_routine()
*/
function ddw_btc_network_new_site_run_plugin_activation( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {

Expand Down
83 changes: 52 additions & 31 deletions includes/admin/admin-extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
/**
* Add "Custom Taxonomy" link to Plugins page.
*
* @since 1.0.0
* @since 1.0.0
*
* @param array $btc_links (Default) Array of plugin action links.
* @param array $btc_links (Default) Array of plugin action links.
* @return strings $btc_links Settings & Menu Admin links.
*/
function ddw_btc_custom_taxonomy_links( $btc_links ) {
Expand Down Expand Up @@ -56,12 +56,12 @@ function ddw_btc_custom_taxonomy_links( $btc_links ) {
/**
* Add various support links to Plugins page.
*
* @since 1.0.0
* @since 1.0.0
*
* @uses ddw_btc_get_info_link()
* @uses ddw_btc_get_info_link()
*
* @param array $btc_links (Default) Array of plugin meta links
* @param string $btc_file Path of base plugin file
* @param array $btc_links (Default) Array of plugin meta links
* @param string $btc_file Path of base plugin file
* @return array $btc_links Array of plugin link strings to build HTML markup.
*/
function ddw_btc_plugin_links( $btc_links, $btc_file ) {
Expand Down Expand Up @@ -98,7 +98,10 @@ function ddw_btc_plugin_links( $btc_links, $btc_file ) {
$btc_links[] = ddw_btc_get_info_link( 'url_snippets', esc_html_x( 'Code Snippets', 'Plugins page listing', 'builder-template-categories' ), 'dashicons-before dashicons-editor-code' );

/* translators: Plugins page listing */
$btc_links[] = ddw_btc_get_info_link( 'url_donate', esc_html_x( 'Donate', 'Plugins page listing', 'builder-template-categories' ), 'button-primary dashicons-before dashicons-thumbs-up' );
$btc_links[] = ddw_btc_get_info_link( 'url_donate', esc_html_x( 'Donate', 'Plugins page listing', 'builder-template-categories' ), 'button dashicons-before dashicons-thumbs-up' );

/* translators: Plugins page listing */
$btc_links[] = ddw_btc_get_info_link( 'url_newsletter', esc_html_x( 'Join our Newsletter', 'Plugins page listing', 'builder-template-categories' ), 'button-primary dashicons-before dashicons-awards' );

} // end if plugin links

Expand All @@ -116,9 +119,12 @@ function ddw_btc_plugin_links( $btc_links, $btc_file ) {
* Modifies the "Thank you" text displayed in the WP Admin footer.
* Fired by 'admin_footer_text' filter.
*
* @since 1.0.0
* @since 1.0.0
* @since 1.4.3 Tweaked rating link.
*
* @uses ddw_btc_get_info_url()
*
* @param string $footer_text The content that will be printed.
* @param string $footer_text The content that will be printed.
* @return string The content that will be printed.
*/
function ddw_btc_admin_footer_text( $footer_text ) {
Expand All @@ -128,11 +134,17 @@ function ddw_btc_admin_footer_text( $footer_text ) {

if ( $is_btc_screen ) {

$rating = sprintf(
/* translators: %s - 5 stars icons */
'<a href="' . ddw_btc_get_info_url( 'url_wporg_review' ) . '" target="_blank" rel="nofollow noopener noreferrer">' . __( '%s rating', 'builder-template-categories' ) . '</a>',
'&#9733;&#9733;&#9733;&#9733;&#9733;'
);

$footer_text = sprintf(
/* translators: 1 - Builder Template Categories / 2 - Link to plugin review */
__( 'Enjoyed %1$s? Please leave us a %2$s rating. We really appreciate your support!', 'builder-template-categories' ),
/* translators: 1 - Plugin name "Builder Template Categories" / 2 - label "5 star rating" */
__( 'Enjoyed %1$s? Please leave us a %2$s. We really appreciate your support!', 'builder-template-categories' ),
'<strong>' . __( 'Builder Template Categories', 'builder-template-categories' ) . '</strong>',
'<a href="https://wordpress.org/support/plugin/builder-template-categories/reviews/?filter=5#new-post" target="_blank" rel="noopener noreferrer">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
$rating
);

} // end if
Expand All @@ -147,8 +159,8 @@ function ddw_btc_admin_footer_text( $footer_text ) {
*
* @since 1.0.1
*
* @see ddw_btc_plugin_update_message()
* @see ddw_btc_multisite_subsite_plugin_update_message()
* @see ddw_btc_plugin_update_message()
* @see ddw_btc_multisite_subsite_plugin_update_message()
*/
function ddw_btc_plugin_update_message_style_tweak() {

Expand All @@ -170,10 +182,10 @@ function ddw_btc_plugin_update_message_style_tweak() {
* Note: This action fires for regular single site installs, and for Multisite
* installs where the plugin is activated Network-wide.
*
* @since 1.0.1
* @since 1.0.1
*
* @param object $data
* @param object $response
* @param object $data
* @param object $response
* @return string Echoed string and markup for the plugin's upgrade/update
* notice.
*/
Expand All @@ -199,10 +211,10 @@ function ddw_btc_plugin_update_message( $data, $response ) {
* Note: This action fires for Multisite installs where the plugin is
* activated on a per site basis.
*
* @since 1.0.1
* @since 1.0.1
*
* @param string $file
* @param object $plugin
* @param string $file
* @param object $plugin
* @return string Echoed string and markup for the plugin's upgrade/update
* notice.
*/
Expand Down Expand Up @@ -242,11 +254,15 @@ function ddw_btc_multisite_subsite_plugin_update_message( $file, $plugin ) {
* Note: The top-level array keys are plugin slugs from the WordPress.org
* Plugin Directory.
*
* @since 1.0.1
* @since 1.4.0 Added new Block Editor recommendations.
* @since 1.0.1
* @since 1.4.0 Added new Block Editor recommendations.
*
* @uses ddw_btc_is_elementor_active()
* @uses ddw_btc_is_block_editor_active()
* @uses ddw_btc_is_block_editor_wanted()
*
* @param array $plugins Array holding all plugin recommendations, coming from
* the class and the filter.
* @param array $plugins Array holding all plugin recommendations, coming from
* the class and the filter.
* @return array Filtered array of all plugin recommendations.
*/
function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
Expand Down Expand Up @@ -286,7 +302,7 @@ function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
/** Register additional Block Editor (Gutenberg) plugin recommendations */
$plugins_block_editor = array();

if ( ddw_btc_is_block_editor_active() ) {
if ( ddw_btc_is_block_editor_active() && ddw_btc_is_block_editor_wanted() ) {

$plugins_block_editor = array(
'classic-editor' => array(
Expand All @@ -299,15 +315,15 @@ function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
'recommended' => 'yes',
'popular' => 'yes',
),
'block-builder' => array(
'disable-gutenberg-blocks' => array(
'featured' => 'yes',
'recommended' => 'yes',
'popular' => 'yes',
'popular' => 'no',
),
'custom-fields-gutenberg' => array(
'block-builder' => array(
'featured' => 'yes',
'recommended' => 'yes',
'popular' => 'no',
'popular' => 'yes',
),
'lazy-blocks' => array(
'featured' => 'yes',
Expand All @@ -324,6 +340,11 @@ function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
'recommended' => 'yes',
'popular' => 'no',
),
'custom-fields-gutenberg' => array(
'featured' => 'yes',
'recommended' => 'yes',
'popular' => 'no',
),
);

} // end if
Expand All @@ -344,9 +365,9 @@ function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
* - "Newest" --> tab in plugin installer toolbar
* - "Version:" --> label in plugin installer plugin card
*
* @since 1.1.0
* @since 1.1.0
*
* @param array $strings Holds all filterable strings of the library.
* @param array $strings Holds all filterable strings of the library.
* @return array Array of tweaked translateable strings.
*/
function ddwlib_plir_strings_plugin_installer( $strings ) {
Expand Down
Loading

0 comments on commit d54f3b3

Please sign in to comment.