farnely
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Authenticate FilterThe authenticate callback only checks the user’s role/capabilities (it’s not where the auth cookie is set). If the user is an administrator, they are redirected to the custom form which is processed using admin-post.php and runs a custom function and this is where the auth cookie is set using wp_set_auth_cookie.
Forum: Developing with WordPress
In reply to: Restricting Access to WP DashboardThank you for this; it’s been a great help.
Forum: Fixing WordPress
In reply to: JPG images fail to displayHi Alan
.htaccess was the only place I didn’t check and that’s what was causing the issue. Thank you so much for the quick turn round and pointing me in the right direction.
Forum: Plugins
In reply to: [iQ Block Country] Undefined Variable in Version 1.2.17With an error like this, something won’t be working right somewhere so any timeline on getting this fixed please?
Forum: Fixing WordPress
In reply to: Appearance of tag contentHaving tried to add CSS to <i>title</i> without success, I’ve discovered (through fairly extensive searches) that styling actually can’t be applied to the title tag. Thanks for your help.
Forum: Fixing WordPress
In reply to: Custom Post Editor?Hi
Rather than looking for a custom post editor, I think what you might need is a plugin that allows you to create your own custom fields. There’s quite a few; go to add new plugins from WP Admin and search “custom fields”. If you want users to provide input using the fields you’ve created, you need to use forms. There are plugins that enable creation of forms too. Once you have your fields, you’ll also be able to display specific field content by creating your own shortcodes to use in your post editor.Hope this helps.
Forum: Fixing WordPress
In reply to: php-error class added to wp admin body since 6.0Thanks for responding and testing. I tracked the issue back to some deprecated PHP in a plugin (have contacted the plugin author).
Forum: Fixing WordPress
In reply to: PHP 8Thank you both for your replies. mysqli wasn’t an available module for PHP 8 in cPanel but nd_mysql was. Checking nd_mysql solved the issue; appreciate your help.
Forum: Developing with WordPress
In reply to: Using $wpdb prepare and IN argumentFor some reason, even though I checked the “notify me” box when I replied, I didn’t then get notified.
@diondesigns
I’m very pleased to report your code executes without error and returns the expected value so thank you very much for your input. You’ve helped solve something that’s been bugging me for a while now.@rossmitchell
thank you for your suggested tweak although it hasn’t changed anything. One thing I forgot to mention in my last response is thatforeach($i in $array)produces an unexpected T_STRING error. Changing it toforeach($array as $i)removes the T_STRING error but still doesn’t produce the expected result overall. The code @diondesigns provided works so I’ll close this now although I’m still puzzled as to why it’s not achievable using my original format – maybe I’ll never know!Forum: Developing with WordPress
In reply to: Using $wpdb prepare and IN argument@rossmitchell tried your suggestion but the ID is no longer being retrieved and still getting an error. when I look at debug.log the content of $alist looks like this:-
”,’ 5′,’ 9′,’ 19′@joyously if I’ve understood you correctly, you’re saying that instead of $array_list in the prepare statement, I should have a unique variable returning each of the IDs in $array meaning my prepare statement should look like this?
$id = $wpdb->get_var( $wpdb->prepare(" SELECT ID FROM {$wpdb->prefix}posts LEFT JOIN {$wpdb->prefix}postmeta ON {$wpdb->prefix}postmeta.post_id={$wpdb->prefix}posts.ID WHERE ID IN ($placeholder_list) AND meta_key = %s AND meta_value = %d ", $id1, $id2, $id3, $key, $value ) );If so, how do I create the required number of unique variables? In my example, I’ve hard-coded the values in the array. In practice, the array is dynamically created and could contain more or fewer and different IDs.
Forum: Everything else WordPress
In reply to: Capability check required?WP Cron runs on my site at the times set by my CRON task in cPanel (it’s not driven by visitor activity). Automatic updates are disabled.
My point is that by visiting that URL (either as an actual visitor or using a script), it’s possible to determine whether the database needs upgrading. That might seem innocent enough but it seems to me that it could be used as a means of identifying websites that are not well maintained/kept up to date and therefore a “good” target for other more sinister intentions.
Forum: Developing with WordPress
In reply to: Database Maintenance Using Scheduled EventThank you both for your responses.
@topher1kenobe : I like your suggestion of using an options table entry and you’ve given me something to think about.
@diondesigns : I have replaced wp cron with a system CRON task. I like the idea of placing the script above root however not so keen on running it from a CRON task in cPanel simply because I’m not sure how many scheduled events I may want to implement and it isn’t easy to organise tasks in cPanel’s CRON manager. Is there any reason why I shouldn’t call the script (if it were placed above root) from within my function in wordpress using require_once or include_once? It doesn’t feel like the “wordpress way” of doing things yet moving wp-config above root appears to be a legitimate thing to do so maybe it would be OK??
Forum: Fixing WordPress
In reply to: WP 5.6.1 & issue with Classic EditorHi again
It only happens for me with pages. Just to be crystal clear:-
if I go to the edit screen for any items listed here (pages): /wp-admin/edit.php?post_type=page, the pop up appears when I leave whether I change anything or not
if I go to the edit screen for any items listed here (posts): /wp-admin/edit.php, the pop up doesn’t appear when I leave
if I go to the edit screen for any items listed here (custom post): /wp-admin/edit.php?post_type=XYZ, the pop up doesn’t appear when I leave
Hope that helps?
Forum: Fixing WordPress
In reply to: WP 5.6.1 & issue with Classic EditorHi @vladytimy
I can confirm this is not happening when editing normal posts (wp-admin/edit.php?post_type=post) or custom posts, only pages.Since it’s not affecting the frontend and changes are taking effect, I can live with it until the fix.
Thanks for opening the ticket. I’d like to keep this open and mark resolved once I’ve tested the fix if that’s OK?
Forum: Fixing WordPress
In reply to: WP 5.6.1 & issue with Classic EditorSorry forgot to mention, if I change the post content and update, there isn’t an issue with the post not updating (it does).