Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

1

Thanks for your help Sally, here is the completed jQuery which pushes the RGB value to another field. Name of the RGB field has _rgb at the end. jQuery(function() { var myOptions = { // you can declare a default color here, // or in the data-default-color attribute on the input defaultColor: false, // a callback to fire ...


0

Here I've modified the code from URL you've given. function _yoursite_get_author_post_type_counts() { static $counts; if (!isset($counts)) { global $wpdb; global $wp_post_types; $sql = <<<SQL SELECT post_type, post_author, COUNT(*) AS post_count FROM {$wpdb->posts} ...


0

You can use the following code to get the post count published by a user in the author.php file $author_id = get_queried_object_id(); $getAuthorPosts = new WP_Query( array( "post_type" => "post", // Replace "post" with your custom post type. e.g. "book" OR "WHATEVER" "author" => $author_id, ) ); echo $...


0

What you have should work - although you should not use $_SESSION (as Tom already noted). Also ID, user_pass, and user_login are all top level in the user object. Here's what I would try: $email = sanitize_email( $_POST['email'] ); $pass = $_POST['password']; $user = get_user_by( 'email', $email ); if ( wp_check_password( $pass, $user->user_pass, $...


0

Here is an other interesting article that makes a decent job of listing all the available css classes/html markup one can use in styling an admin page. The articles is a little outdated in that it show styling results from older version of WordPress, so its likely that additional classes have been added since. Another useful resources are the WordPress ...


1

All users with author and contributor roles - actualy any in-built role above subscriber - should be available from the author dropdown. However, if you want organization_administrator users to be available also, you will need to assign those users a contibrutor or author role as well (anything more than subscriber.) This seems to be due to a throwback from ...


0

Hi Sir hope these can help: You need to check your database and see if the posts are really duplicated(maybe it is only visual duplicates for same posts), you will need to use a mysql client like phpmyadmin or similar solutions. you will check the wp_posts table. Post (content) data are not really in duplicates : (only one same post in the database) there's ...


1

There are several really good plugins, like "MultiSite Clone Duplicator", that allow you to clone/duplicate and existing site. I run a multisite installation with over 200 sites. We started by creating a basic "template" site, which held all the basic/default settings we wanted for every new site. Then, we just clone that each time we want a new site. ...


0

You can check here how to add no-link class into woocommerce order list row orginal issue asked here https://github.com/woocommerce/woocommerce/issues/18704 orginal issue asked answer here https://github.com/woocommerce/woocommerce/pull/18708


0

You have to upload .htaccess file on root folder. First create file with name ".htaccess". Paste below code to this created file : # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule&...


0

If your site uses permalinks, try going to Settings > Permalinks and then click on Save. It will refresh your permalinks and will typically solve the issue.


1

So it looks like there is some page redirecting going on in the post updating process, hence why I can't even access a $GLOBALS variable. The only alternative I found to use was to use a session variable. Something like: add_filter( 'pre_insert_term', 'pre_insert_term_action', 10, 2 ); add_action( 'admin_notices', 'show_example_error' ); function ...


0

I'd go for something like this: function my_notices() { $screen = get_current_screen(); if ($screen->id === 'your-id') { //or anything else if (isset($_GET['save'])) { // or $_SESSION or transient <div class="error"> <p>My example warning message.</p> </div> <?php } ...


0

In principle, just resetting the password, plus invoke the "Log out everywhere else" on the user profile, should be enough to prevent benign user knowing the password. Reset the web host customer password, including any associated FTP account password. Use strong and unique passwords. But, in case any unknown, possibly malicious user, may have had wp-admin, ...


Top 50 recent answers are included