Mustafa Bharmal
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: custom searchBecause LIKE in MySQL is case-insensitive but string-based, searching “6805” fails if WordPress sanitizes s as a string and skips numeric-only values.
Solution: cast search term to string and force a meta query even for numbers, add this before $query->set(‘s’, ”);:
$searchterm = strval($query->query_vars['s']);Also, add ‘type’ => ‘CHAR’ in your meta query:
$meta_query[] = array(
'key' => $cf,
'value' => $searchterm,
'compare' => 'LIKE',
'type' => 'CHAR',
);This makes numeric searches like “6805” work.
Forum: Developing with WordPress
In reply to: Permission question regarding rolesThen I would suggest you to deactivate the plugin and activate it again. I hope It will solve the problem.
Forum: Developing with WordPress
In reply to: Permission question regarding rolesThis issue occurs because the old role data is stored in the database (wp_user_roles option).
To fix it, first remove the existing role, then recreate it cleanly:// Step 1: Remove old role (run once)
remove_role('my_role');Then run your code block again. I hope it will work.
Forum: Fixing WordPress
In reply to: Plugin doesn’t workCan you share more details like the plugin name, any screenshot to help you with the problem you are facing.
Forum: Fixing WordPress
In reply to: WordPress automatically saves as “AUTO DRAFT”Yeah, Initially the WordPress will save all its post to the auto-draft state, until and unless you published the particular post. Try to change the status of post from the draft to published and see if you get the result you are expecting.
I would suggest you to do the follow steps.
Check cron jobs.
Compare.htaccesswith a fresh one.
Reset all passwords.
Reinstall core/plugins if needed.
Uninstall the plugins which are not needed.