Skip to content

Commit

Permalink
Ticket #FP-22 - Fixed issue, Unable to save settings in admin area
Browse files Browse the repository at this point in the history
- Code was using the reserved word `post_type`, renamed the field to `fpost_type` throughout
  • Loading branch information
Sharron Denice committed Jan 9, 2015
1 parent 07151e6 commit 4c6e72e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
22 changes: 20 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://www.thesoftwarepeople.com/software/plugins/wordpress/feature
Tags: featured posts display gallery slider jquery moving boxes the software people
Requires at least: 3.5.1
Tested up to: 4.1
Stable tag: 1.2.6
Stable tag: 1.2.7
License: Apache v2.0
License URI: http://www.apache.org/licenses/LICENSE-2.0

Expand All @@ -19,7 +19,7 @@ The Software People's (TSP) Featured Posts plugin allows you to add featured pos
Add a `Featured Posts` to posts and pages by using a shortcode inside your text or evaluated from within your theme. You may override page/post `Featured Posts` options with shortcode attributes defined on the plugin's settings page.

* `[tsp-featured-posts]` - Will display posts with the default options defined in the plugin's settings page.
* `[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_event_data="N" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_class="" post_type="post" post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]` - Will override all attributes defined on the plugin's settings page.
* `[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_event_data="N" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_class="" fpost_type="post" post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]` - Will override all attributes defined on the plugin's settings page.

== Installation ==

Expand All @@ -37,6 +37,18 @@ BEFORE YOU BEGIN: Requires the installation and activation of [TSP Easy Dev Late

== Frequently asked questions ==

= I've installed the plugin but when I save I get the message "Cannot load tsp-featured-posts.php."? =
1. We sincerely apologize this was a bug introduced in versions 1.2.4 - 1.2.6 and fixed in 1.2.7+
2. A quick fix would be to set "Post Type" to an empty string on the settings page to get past the error
3. The best solution would be to download version 1.2.7 and follow the instructions in the next steps.
4. Navigate to the plugins page and click "Update Now" under "TSP Featured Posts" to get version 1.2.7 (or newer versions)
5. Once activated go back to the TSP Plugins->Featured Posts settings page and set all "Post Type" fields to empty (There will be 2 fields)
6. Save Changes & Refresh Page
7. Again, Save Changes & Refresh Page
8. You should only see one "Post Type" field now, set it to "post" or any post type you'd like, Save Changes
9. Please update your shortcodes to use `fpost_type` instead of `post_type` (Note: `post_type` is a reserved WP keyword and was the cause of the issue)
10. Bug fixed. Apologies for the inconvenience.

= I've installed the plugin but my posts are not displaying? =

1. Make sure the folder `/wp-content/uploads/` has recursive, 777 permissions
Expand All @@ -51,6 +63,9 @@ BEFORE YOU BEGIN: Requires the installation and activation of [TSP Easy Dev Late

== Changelog ==

= 1.2.7 =
* Fixed bug: Fixed issue FP-22 Unable to save settings in admin area (See: [FIX INSTRUCTIONS](https://wordpress.org/plugins/tsp-featured-posts/faq/))

= 1.2.6 =
* Enhancement: Allow user to add additional post classes

Expand Down Expand Up @@ -124,6 +139,9 @@ BEFORE YOU BEGIN: Requires the installation and activation of [TSP Easy Dev Late

== Upgrade notice ==

= 1.2.7 =
Fixed bug: Fixed issue FP-22 Unable to save settings in admin area (See: [FIX INSTRUCTIONS](https://wordpress.org/plugins/tsp-featured-posts/faq/))

= 1.2.6 =
Enhancement: Allow user to add additional post classes

Expand Down
3 changes: 2 additions & 1 deletion TSP_Easy_Dev.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@
'label' => 'Post Class',
'value' => '',
),
'post_type' => array(
'fpost_type' => array(
'type' => 'INPUT',
'label' => 'Post Type',
'value' => 'post',
'old_labels' => array ('post_type'),
),
'post_ids' => array(
'type' => 'INPUT',
Expand Down
8 changes: 4 additions & 4 deletions TSP_Easy_Dev.extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function display_widget( $fields, $echo = true )
}

$args = array(
'post_type' => $post_type,
'post_type' => $fpost_type,
'category' => $category,
'numberposts' => $number_posts,
'orderby' => $order_by,
Expand All @@ -274,7 +274,7 @@ public function display_widget( $fields, $echo = true )
if ($show_private == 'Y')
$args['post_status'] = "publish,private";

if ($post_type == 'tribe_events')
if ($fpost_type == 'tribe_events')
{
$args['meta_query'] = array(
array(
Expand Down Expand Up @@ -365,7 +365,7 @@ public function display_widget( $fields, $echo = true )
$full_preview = implode(' ', $words);
}//end if

if (!$protected && $post_type == 'tribe_events' && $show_event_data == 'Y')
if (!$protected && $fpost_type == 'tribe_events' && $show_event_data == 'Y')
{
$venue = '<div class="duration venue">'.tribe_get_venue().'</div>';
$schedule = '<div class="duration time">'.tribe_events_event_schedule_details().'</div>';
Expand Down Expand Up @@ -407,7 +407,7 @@ public function display_widget( $fields, $echo = true )
$text = implode(' ', $words);
}//end if

if (!$protected && $post_type == 'tribe_events' && $show_event_data == 'Y')
if (!$protected && $fpost_type == 'tribe_events' && $show_event_data == 'Y')
{
$venue = '<div class="duration venue">'.tribe_get_venue().'</div>';
$schedule = '<div class="duration time">'.tribe_events_event_schedule_details().'</div>';
Expand Down
6 changes: 3 additions & 3 deletions templates/tsp-featured-posts_shortcode_settings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ul style="padding-left: 30px;">
<li>Title: <strong>title="Title of Posts"</strong></li>
<li>Max Words in Title: <strong>max_words=10</strong></li>
<li>Show Event Data: <strong>show_event_data="Y"</strong>(Options: Y, N - Requires The Event Calendar plugin &amp; post_type="tribe_events")</li>
<li>Show Event Data: <strong>show_event_data="Y"</strong>(Options: Y, N - Requires The Event Calendar plugin &amp; fpost_type="tribe_events")</li>
<li>Show Author: <strong>show_author="Y"</strong>(Options: Y, N)</li>
<li>Show Publish Date: <strong>show_date="Y"</strong>(Options: Y, N)</li>
<li>Show Quotes: <strong>show_quotes="Y"</strong>(Options: Y, N)</li>
Expand All @@ -23,7 +23,7 @@
<li>Excerpt Length (Layouts #0 & #3): <strong>excerpt_min="60"</strong></li>
<li>Excerpt Length (Layouts #1, #2, #4[Slider], #5): <strong>excerpt_max="100"</strong></li>
<li>Post Class: <strong>post_class=""</strong>(Example: columns1_3, columns1_2)</li>
<li>Post Type: <strong>post_type="post"</strong>(Options: post, varies)</li>
<li>Post Type: <strong>fpost_type="post"</strong>(Options: post, varies)</li>
<li>Post IDs: <strong>post_ids="5,3,4"</strong></li>
<li>Category: <strong>category="0"</strong>(Any category ID, 0 returns all categories)</li>
<li>Slider Width: <strong>slider_width="865"</strong></li>
Expand All @@ -50,7 +50,7 @@
</ul>
<hr>
A shortcode with all the options will look like the following:<br><br>
<strong>[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_event_data="N" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_class="" post_type="post" post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]</strong>
<strong>[tsp-featured-posts title="Title of Posts" keep_formatting="N" style="color: red;" max_words=10 show_quotes="N" show_thumb="Y" show_event_data="N" show_author="Y" show_date"N" show_private="N" show_text_posts="N" number_posts="5" excerpt_max=100 excerpt_min=60 post_class="" fpost_type="post" post_ids="5,3,4" category="0" slider_width="865" slider_height="365 layout="0" order_by="DESC" thumb_width="80" thumb_height="80" read_more_text="more..." before_title="" after_title=""]</strong>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion tsp-featured-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Description: Featured Posts allows you to <strong>add featured posts with quotes to your blog</strong>'s website. Powered by <strong><a href="http://wordpress.org/plugins/tsp-easy-dev/">TSP Easy Dev</a></strong>.
Author: The Software People
Author URI: http://www.thesoftwarepeople.com/
Version: 1.2.6
Version: 1.2.7
Text Domain: tspfp
Copyright: Copyright � 2013 The Software People, LLC (www.thesoftwarepeople.com). All rights reserved
License: APACHE v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down

0 comments on commit 4c6e72e

Please sign in to comment.