professor99
Forum Replies Created
-
One thing I forgot to mention is that this change only addresses the use of a separate Add Post page using the wpuf_addpost shortcode.
Some consideration also needs to be given to using this as an in page editor like the “Reply” form at the bottom of this page. In this case the Close button isn’t appropriate but you would always want to be redirected back to the original page after login or post.
More thoughts on this later.
Cheers
TheProfessorWill do Tareq.
Will be updating the Edit Posts functionality during the next two weeks along the same lines as I have mentioned in my other posts. So once completed and tested I will fork it in GitHub.
However will provide a link before that to the zipped code for the New Post functionality I’ve already implemented and tested including examples of it’s use.
I will try contacting you direct via you Tareqs Planet contact page so I can give you a login to my test site so you can check out the work in action.
I’m very happy to contribute to your most excellent plugin.
Big Thanks
TheProfessor
This affects my application as my users are all “Authors”. So if your not a coder and nobody else fixes it first I will end up fixing it next weekend.
Cheers
TheProfessorUpdate on this here Close Button and return on Post
Then again I have that option set correctly and I get the same error too when logged in as an “author”. Works when I am logged in as an editor.
If WP User Frontend observed default WordPress role capabilities the only users besides non-logged in users that shouldn’t be able to delete their own posts should be those with the WordPress role “Subscriber”.
So this is definitely a bug.
Cheers
The ProfessorWithout looking at the code one thing that may cause this is the “WP User Frontend:Settings” – “Others” -> “Users can delete post?” option being set to “No”.
Cheers
TheProfessorCategories can be selected via your Add Post or Edit Page posts if you have the “WP User Frontend:Settings” – “Frontend Posting” -> “Allow to choose category?” option enabled.
You will have to change the following code in the file wpuf-add-post.php.
function shortcode( $atts ) { ..... if ( is_user_logged_in() ) { $this->post_form( $post_type ); } else { printf( __( "This page is restricted. Please %s to view this page.", 'wpuf' ), wp_loginout( get_permalink(), false ) ); } ..... }cheers
The ProfessorSlight correction and additional info
The original script at the top of the last post should be
Original
function showtime_jQuery_method() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'); wp_enqueue_script( 'jquery' ); } add_action('wp_enqueue_scripts', 'showtime_jQuery_method');To fix the offending plugin if it is compatible with JQuery version 1.7.2 alter the plugin code appropriately using one of the following options as a template
Option 1.
function showtime_jQuery_method() { // wp_deregister_script( 'jquery' ); // wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'); wp_enqueue_script( 'jquery' ); } add_action('wp_enqueue_scripts', 'showtime_jQuery_method');Option 2
function showtime_jQuery_method() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); wp_enqueue_script( 'jquery' ); } add_action('wp_enqueue_scripts', 'showtime_jQuery_method');Cheers
The ProfessorResolution
Upon further investigations I found that http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js?ver=3.4.2 was been loaded but another plugin (showtime) using the following script.
function showtime_jQuery_method() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'); wp_enqueue_script( 'jquery' ); } //add_action('wp_enqueue_scripts', 'showtime_jQuery_method');It seems according to this link http://wordpress.org/support/topic/notice-wp_deregister_script-was-called-incorrectly plugins like to fix their JQuery version using such code.
Unfortunately using JQuery 1.8 will break WordPress 3.4.2 as seen here.
Solutions
Presently I have four solutions for this problem.
1. Change the JQuery version to 1.7.2 on the offending plugin (or alternatively comment the offending code out as I did which then causes it to default to the current wordpress JQuery version). In this case the Showtime Plugin seems to be quite happy with JQuery 1.7.2. If the given plugin absolutely requires the specified JQuery version try one of the following.
2. Use my original fix which was to substitute wp-includes\js\jquery\ui\jquery.ui.core.min.js with the newer version v1.8.24 from https://github.com/jquery/jquery-ui/blob/1-8-stable/ui/jquery.ui.core.js
3. Insert the code jQuery.curCSS = jQuery.css; where appropriate
4. Wait for a newer version of WordPress that includes an updated JQuery UI.
Conclusion
My investigtions also hint there maybe maybe other side effects of this bug depending on code.
In conclusion this and maybe other bugs in WP User Frontend may be caused by other plugins that use JQuery version substitution.
So before one reports a WP User Frontend bug one needs to disable other plugins to see if they are the cause.
Hope this helps other people who come across this hard to resolve bug.
Cheers
The ProfessorUpdate1
Checked the admin editor load and found it was executing the following jquery file
file: wp-includes/js/jquery/jquery.js?
version: 1.7.2In this file there is the following line which is executed on editor load.
f.curCSS=f.css
In the unminified version of this file this reads as
// DEPRECATED in 1.3, Use jQuery.css() instead
jQuery.curCSS = jQuery.css;Commenting this out produces the same behaviour as the WP User Frontend exhibits on clicking the link button.
Found WP User Frontend wasn’t using this JQuery file at all. Instead it uses
http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js?ver=3.4.2
which is JQuery version 1.8 which doesnt include “jQuery.curCSS = jQuery.css;” and hence the problem.
So the real problem is why is WP User Frontend using the googleapis version and not the local wp-includes version? Which should it be using?
TheProfessor