Essential Content Types - Version 1.8.5

Version Description

(Released: December 14, 2020) = * Bug Fixed: ECT archive title messing with other NON-ECT archive title

Download this release

Release Info

Developer catchthemes
Plugin Icon Essential Content Types
Version 1.8.5
Comparing to
See all releases

Code changes from version 1.8.4 to 1.8.5

README.txt CHANGED
@@ -201,6 +201,9 @@ Not so easy way (via FTP) :
201
 
202
  == Changelog ==
203
 
 
 
 
204
  = 1.8.4 (Released: December 07, 2020) =
205
  * Bug Fixed: ECT archive title and description via customizer
206
  * Compatibility check up to version 5.6
201
 
202
  == Changelog ==
203
 
204
+ = 1.8.5 (Released: December 14, 2020) =
205
+ * Bug Fixed: ECT archive title messing with other NON-ECT archive title
206
+
207
  = 1.8.4 (Released: December 07, 2020) =
208
  * Bug Fixed: ECT archive title and description via customizer
209
  * Compatibility check up to version 5.6
essential-content-types.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Essential Content Types
17
  * Plugin URI: https://catchplugins.com/plugins/essential-content-types/
18
  * Description: Essential Content Types allows you to feature the impressive content through different content/post types on your website just the way you want it. These content/post types are missed by the themes in WordPress Theme Directory as the feature falls more towards the plugins’ territory.
19
- * Version: 1.8.4
20
  * Author: Catch Plugins
21
  * Author URI: https://catchplugins.com
22
  * License: GPL-3.0+
@@ -31,7 +31,7 @@ if ( ! defined( 'WPINC' ) ) {
31
  }
32
 
33
  // Define Version
34
- define( 'ESSENTIAL_CONTENT_TYPES_VERSION', '1.8.4' );
35
 
36
  /**
37
  * The code that runs during plugin activation.
@@ -199,13 +199,41 @@ if ( 1 == $ctp_options['theme_plugin_tabs'] ) {
199
  }
200
  }
201
 
202
- add_filter( 'get_the_archive_title', 'ect_modify_archive_title', 10, 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
 
 
 
 
 
 
 
 
204
  function ect_modify_archive_title( $title ) {
205
  $title_label = '<span class="some-class">%1$s</span>%2$s';
206
  $type = ect_get_archive_post_type();
207
 
208
- $archive_title = get_option( $type );
 
 
 
 
 
 
 
209
 
210
  if ( '' !== $archive_title ) {
211
  return trim(
@@ -228,7 +256,6 @@ function ect_modify_archive_title( $title ) {
228
  }
229
 
230
  function ect_get_archive_post_type() {
231
- $post_type = false;
232
 
233
  global $wp_query;
234
  if ( isset( $wp_query->query['post_type'] ) ) {
16
  * Plugin Name: Essential Content Types
17
  * Plugin URI: https://catchplugins.com/plugins/essential-content-types/
18
  * Description: Essential Content Types allows you to feature the impressive content through different content/post types on your website just the way you want it. These content/post types are missed by the themes in WordPress Theme Directory as the feature falls more towards the plugins’ territory.
19
+ * Version: 1.8.5
20
  * Author: Catch Plugins
21
  * Author URI: https://catchplugins.com
22
  * License: GPL-3.0+
31
  }
32
 
33
  // Define Version
34
+ define( 'ESSENTIAL_CONTENT_TYPES_VERSION', '1.8.5' );
35
 
36
  /**
37
  * The code that runs during plugin activation.
199
  }
200
  }
201
 
202
+ /* Modify ECT Post type archive title for default values */
203
+ function ect_check_archive_title(){
204
+ global $wp_query;
205
+ $post_type = false;
206
+ if ( isset( $wp_query->query['post_type'] ) ) {
207
+ $post_type = $wp_query->query['post_type'];
208
+ }
209
+
210
+ $ect_post_types = array(
211
+ 'featured-content',
212
+ 'jetpack-portfolio',
213
+ 'jetpack-testimonial',
214
+ 'ect-service',
215
+ );
216
 
217
+ if( $post_type !== false || in_array($post_type, $ect_post_types, true)) {
218
+ add_filter( 'get_the_archive_title', 'ect_modify_archive_title', 10, 1 );
219
+ }
220
+ }
221
+
222
+ add_action('init', 'ect_check_archive_title');
223
+
224
+ /* set default title if options not found */
225
  function ect_modify_archive_title( $title ) {
226
  $title_label = '<span class="some-class">%1$s</span>%2$s';
227
  $type = ect_get_archive_post_type();
228
 
229
+ $default_title = array(
230
+ 'ect_service_title' => esc_html( 'Services', 'essential-content-types' ),
231
+ 'jetpack_testimonial_title' => esc_html( 'Testimonial', 'essential-content-types' ),
232
+ 'jetpack_portfolio_title' => esc_html( 'Portfolio', 'essential-content-types' ),
233
+ 'featured_content_title' => esc_html( 'Featured Content', 'essential-content-types' ),
234
+ );
235
+
236
+ $archive_title = get_option( $type, $default_title[ $type ] );
237
 
238
  if ( '' !== $archive_title ) {
239
  return trim(
256
  }
257
 
258
  function ect_get_archive_post_type() {
 
259
 
260
  global $wp_query;
261
  if ( isset( $wp_query->query['post_type'] ) ) {
includes/class-essential-content-types-activator.php CHANGED
@@ -30,27 +30,26 @@ class Essential_Content_Types_Activator {
30
  * @since 1.0.0
31
  */
32
  public static function activate() {
33
- array( 'Jetpack_Portfolio', 'activation_post_type_support' );
34
 
35
- $options = array(
36
- 'ect_portfolio',
37
- 'ect_testimonial',
38
- 'ect_featured_content',
39
- 'ect_service',
40
- 'ect_food_menu',
41
- );
42
 
43
- $value = array( 'status' => 1 );
44
-
45
 
46
- foreach ( $options as $option ) {
47
- $option_value = get_option( $option );
48
- if( ( 'ect_food_menu' == $option ) && ( 1 != $option_value['status'] ) ) {
49
- update_option( $option, array( 'status' => 0 ) );
50
- } else {
51
- update_option( $option, $value );
52
- }
53
- }
54
  }
55
 
56
  }
30
  * @since 1.0.0
31
  */
32
  public static function activate() {
33
+ array( 'Jetpack_Portfolio', 'activation_post_type_support' );
34
 
35
+ $options = array(
36
+ 'ect_portfolio',
37
+ 'ect_testimonial',
38
+ 'ect_featured_content',
39
+ 'ect_service',
40
+ 'ect_food_menu',
41
+ );
42
 
43
+ $value = array( 'status' => 1 );
 
44
 
45
+ foreach ( $options as $option ) {
46
+ $option_value = get_option( $option );
47
+ if ( ( 'ect_food_menu' == $option ) && isset( $option_value['status'] ) && ( 1 != $option_value['status'] ) ) {
48
+ update_option( $option, array( 'status' => 0 ) );
49
+ } else {
50
+ update_option( $option, $value );
51
+ }
52
+ }
53
  }
54
 
55
  }
languages/essential-content-types-fr_FR.mo CHANGED
Binary file
languages/essential-content-types-fr_FR.po CHANGED
@@ -4,8 +4,8 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Essential Content Types\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
7
- "POT-Creation-Date: 2020-12-07 00:51-0500\n"
8
- "PO-Revision-Date: 2020-12-07 00:51-0500\n"
9
  "Last-Translator: Charles Girardin <girardin.charles.57@gmail.com>\n"
10
  "Language-Team: Catch Plugins <info@catchplugins.com>\n"
11
  "Language: fr_FR\n"
4
  msgstr ""
5
  "Project-Id-Version: Essential Content Types\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
7
+ "POT-Creation-Date: 2020-12-14 00:28-0500\n"
8
+ "PO-Revision-Date: 2020-12-14 00:28-0500\n"
9
  "Last-Translator: Charles Girardin <girardin.charles.57@gmail.com>\n"
10
  "Language-Team: Catch Plugins <info@catchplugins.com>\n"
11
  "Language: fr_FR\n"
languages/essential-content-types.pot CHANGED
@@ -5,7 +5,7 @@ msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Essential Content Types\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
8
- "POT-Creation-Date: 2020-12-07 00:51-0500\n"
9
  "PO-Revision-Date: 2016-12-12 09:23-0500\n"
10
  "Last-Translator: Sakin Shrestha <info@catchplugins.com>\n"
11
  "Language-Team: Catch Plugins <info@catchplugins.com>\n"
5
  msgstr ""
6
  "Project-Id-Version: Essential Content Types\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
8
+ "POT-Creation-Date: 2020-12-14 00:28-0500\n"
9
  "PO-Revision-Date: 2016-12-12 09:23-0500\n"
10
  "Last-Translator: Sakin Shrestha <info@catchplugins.com>\n"
11
  "Language-Team: Catch Plugins <info@catchplugins.com>\n"