s1de7
Forum Replies Created
-
I add the filter to the upload_dir hook in the functions.php of the theme. This is working for media files and as returned by wp_upload_dir().
I just tested adding the filter as a mu-pluging and now it is working. This means your plugin is calling wp_upload_dir() before the theme is loaded.
- This reply was modified 1 year, 9 months ago by s1de7.
Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updateok, it seems that’s where the query alteration belongs. it doesn’t make sense anymore to use
pre_get_commentsfor this…Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updatefor opening the ticket, i was to lazy…
Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updateand already fixed. thanks!
Forum: Hacks
In reply to: WordPress 4.2.1 pre_get_comments doesn't work after updatethanks! but altering the clauses may actually be a bad idea because it breaks caching. it doesn’t matter in your case but on frontend the comments query is cached using a unique key based on the query string. if you dynamically alter the clauses and use a persistant cache it returns the same cache for the same query string and possibly different clauses.
i ended up using the
comments_arraywhich doesn’t break the cache but is not so ideal performance-wise. would be nice ifpre_get_commentswould work again as expected…Forum: Plugins
In reply to: [qTranslate X] The latest beta from GitHub is good for testing – Thank You!i think this is not a good approach anyway – in worst case you query 1000s of comments WITH the corresponding posts, PLUS filtering the post content –
i wrote my own solution a while ago… i think it’s way more effective to save the current language to a comment meta when the comment is saved. this way you can easily query comments by meta.
Forum: Plugins
In reply to: [qTranslate X] The latest beta from GitHub is good for testing – Thank You!this one is new since one of the latest dev versions:
add_filter('comments_clauses','qtranxf_excludeUntranslatedPostComments',10,2)
this function doesn’t even exist in earlier versions.i get a
WordPress database error Unknown column 'wp_posts.post_content' in 'where clause' for query SELECT * FROM wp_comments[…]
but only on some sites of my multisite network. still investigating.unfortunately i could not reproduce the error with a clean 2015 – BUT
get_comments()still returns an empty array! the 2015 recent comment widget DOES return the comments, but ALL, also for untranslated posts, though.Forum: Plugins
In reply to: [qTranslate X] incompatibility with 'PS Disable Auto Formatting'i think this should be in the hands of plugin authors to handle it if they manipulate / duplicate core functions.
will you add this to the plugin? otherwise i would have to use this as a patch…
Forum: Plugins
In reply to: [qTranslate X] excerpt field in backend editorForum: Plugins
In reply to: [qTranslate X] The latest beta from GitHub is good for testing – Thank You!@john: there’s a serious bug in qtranslate_frontend.php line 356
i don’t know what you are trying to do with the comments query? if you alter the query that way it breaks any call of
get_comments()outside of the loop where ‘where’ doesn’t contain ‘comment_post_ID’ – this is very likely happening with ‘recent comments’ widgets.what are you trying to achieve anyway? is this a typo and you were going for ‘comment_content’ instead of ‘post_content’? why are you filtering the comments?
Forum: Plugins
In reply to: [qTranslate X] The latest beta from GitHub is good for testing – Thank You!@john: i am still investigating the database error. i’ll get back to you asap, in the next few hours.
Forum: Plugins
In reply to: [qTranslate X] The latest beta from GitHub is good for testing – Thank You!i get lots of database errors with the latest dev version.
and are excerpts supposed to work in the editor?? because the lang switch doesn’t affect the excerpt field…
Forum: Networking WordPress
In reply to: Why not just login automatically when user is activated?well, the hook would be ‘wpmu_activate_user’ and – of course – i added an action to it with the snippet above. (slightly changed.) i did
NOT EDIT ANY CORE FILES!!
this is absolutely not recommended and i am sorry that i wasn’t clear about this before.
this is the code i used:
function custom_login_new_user( $user_id, $email, $meta ) { $user = new WP_User( (int) $user_id ); $creds = array(); $creds['user_login'] = $user->user_login; $creds['user_password'] = $meta['user_pass']; $creds['remember'] = true; $user = wp_signon( $creds, false ); wp_set_current_user($user->ID); if ( is_wp_error($user) ) { echo $user->get_error_message(); } else { // safe redirect to actually login the user - otherwise they would need to manually refresh the page // PLUS: this clears the activation confirmation page with the plain text password printed on screen wp_safe_redirect( get_home_url() ); exit; } } add_action( 'wpmu_activate_user', 'custom_login_new_user', 10, 3 );Forum: Networking WordPress
In reply to: Why not just login automatically when user is activated?thanks for this snippet! i use it in my network now.
this is WAY better than showing the password – in plain text – on the screen in the browser after activation! (which is very far away from secure…)
Forum: Plugins
In reply to: [Auto Insert Title To Link] MultisiteAs a workaround, you can edit the plugin and remove the line
* Network: trueYou can than activate it individually and it works fine. 🙂