Forum Replies Created

Viewing 15 replies - 76 through 90 (of 177 total)
  • If you only have a handful of posts, then moving them over to each post individually would be fine. However, if you have many posts with many images, manually copying the wp-content/uploads folder would likely be quicker. If you have access to FTP with your hosting company, you could download the folder from site A, then upload to site B. Either way will get the job done!

    Yeah, that’s a strange one. After re-reading your original question, the only thing I can think that might cause this would be characters in a different encoding that looks correct at first glance but is actually different characters stored. Otherwise, if the email address is stored in the database in the user table and it’s the same exact one you manually enter (which subsequently works), I’m not sure what would cause this.

    Something else you could try tracing the code to where it’s trying to use that email address in wp_login and see if it’s pulling from anywhere different than the users table (maybe some user meta overriding things?) or bringing the value in incorrectly.

    @tabytharourke Your best bet is to ask in a support forum for the SSO plugin you’re using since it may be a configuration issue or bug. However, to add my own experience using an SSO plugin, I had a similar issue where users were created in WordPress from SSO and added invalid characters in the username. (eg, firstname.lastname) . Though it was saved, it created issues in other functionality, and I needed to create a fix for the issue so the user accounts would work properly.

    I’m wondering if something similar is happening with email addresses. I’d recommend comparing the email address that should have been added with the user accounts that weren’t added properly and see if anything stands out, such as common characters or spacing that could be problematic. Again, it’s probably something specific to the SSO plugin, but I wanted to mention my experience.

    You’ll want to transfer everything in your wp-content/uploads folder as well, as those won’t be brought over to the new site automatically.

    How were you planning on migrating the site content? Doing an import/export using the built-in exporter plugin? You could try that first and see if it migrates everything as you would expect (you’ll need to copy the uploads folder as well).

    If that doesn’t work there are plugins you could use to expedite the migration, which would likely move the images for you. I haven’t used this in a while and don’t have knowledge about how to use the plugin, but https://wordpress.org/plugins/all-in-one-wp-migration/ could be a solution to help expedite things.

    The challenge is that you already have content created on the new site, otherwise, I’d recommend copying the database to the new site (which won’t work with your setup, unfortunately).

    @stephrookie You may want to ask in the Gutenberg support forum, but from what I can tell from reading the code, there isn’t a way you’d be able to do this without adjusting the block in a significant way.

    I do want to point out that there is an ‘exclude’ parameter when you switch to the code editor and you can hardcode a list of post IDs to exclude from the list. I know it’s not dynamic or based on a tag, but it might help exclude specific content from your block.

    It sounds like it would be a great feature request, I encourage you to make a recommendation to the Gutenberg support forum!

    I’d recommend doing it before the changeover so that when you switch the site over, it has all the content that is needed when launching the site. Otherwise, you’re going to temporarily have missing pages and 404 errors on Google.

    OK, assuming you have a custom screen you are adding the button to (instead of creating a block), you should be able to take the following steps to add some custom logic for your button:

    1) When the button submits, I assume you want it to submit a form. Make sure your button has a unique name and implements a nonce for security.
    2) Add a custom function into a hook that has the appropriate timing of when you want to fire your custom logic. For example, if you want to run your custom logic when WordPress is initialized, you’d set up something along the following:

    function maybe_process_button(){
        // Check for the form field, either in $_POST or $_GET, depending on how it was set up
        // Check for valid nonce
        // If that field exists and has the expected value, then run your custom logic
    }
    
    add_action( 'init', 'maybe_process_button' );

    3) That should do what you need to do for processing custom logic. If you’re trying to hook into existing admin hooks, you’d take the logic described and replace it with the specific action you are trying to target.

    I hope that helps clarify how you’d be able to set the button up to work as you desire.

    @deborah113 You can link to an external URL by adding a ‘Custom Link’ from the menu administration screen. If you go to ‘Appearance’ => ‘Menus’, you’ll see the ‘Custom Links’ option in the lefthand section for types of links to add to the menu. See screenshot for an example: https://d.pr/i/kRfNMd

    You can then add your full URL and a text for the link, add it to the menu and drag it to its new location.

    @stirdigital You may have luck asking your question in the Gutenberg support forum at https://wordpress.org/support/plugin/gutenberg/.

    You could always update your custom CSS to work with the new structure (not ideal, I know). Another possibility is upgrading WordPress but installing an older version of the Gutenberg plugin from https://wordpress.org/plugins/gutenberg/advanced/ (scroll to the bottom of the page). This will let you lock into a specific version of Gutenberg while the rest of WordPress can be updated. Again, this is not an ideal solution, but it could buy you time to update your CSS to work with the new markup.

    I wish I had more insightful news, good luck, and hopefully, the Gutenberg threads can point you in the right direction.

    @danield99 Is your custom plugin adding a tab to a block in the editor or adding a tab to an admin page? I couldn’t quite tell from your screenshot its intended use.

    Would you be able to add a bit more information about what you’re trying to achieve such as what page you are trying to create the functionality on? If you have any current code you would be willing to link to, that might help as well.

    In short: there’s definitely a way to create a custom button to assign an action, but which action and how you would do that all depends on where it’s intended to be used. Thank you.

    @hansvmourik Looking through your code, it doesn’t appear that you’re setting the metadata for the new posts (unless I’m missing something). You’re creating an array of $my_post for wp_update_post() which is good, but the metadata from the original post isn’t being set anywhere. When you use get_post() to get the original post data, it’s not grabbing the post metadata, as that function will only return a WP_Post object, which doesn’t include metadata.

    I’d recommend to create a new variable on the line under $new_post = which does something like $new_post_metadata = get_post_meta( $post_id );. https://developer.wordpress.org/reference/functions/get_post_meta/ This will get all the post meta keys set for the original post and set them in a variable. Then any time you run wp_update_post() or wp_insert_post() you can either set an array element to $my_post that has meta_input set (as described in the comments section here or you can loop through the $new_post_metadata array elements and run update_post_meta() for each one. The former is likely more efficient.

    I hope that helps!

    Hi @iqbrb, if I’m understanding correctly, you’re trying to implement a search field on your WordPress site to search for tags and then link off to the tag archive page, correct?

    If you are intending on hooking into existing search templates so you can take advantage of pagination and existing search functionality, it would be tricky (though not impossible), as the WordPress search is build to search for posts (or other post types), not terms.

    I’d actually recommend creating a custom search form on a template or block that you’d implement. You’ll want to make sure you’re implementing a nonceonto the form to ensure your form is implemented securely and that you’re sanitizing any input before using.

    A general outline of how I’d recommend approaching this:

    1) Create form with search field and custom input names that you’ll be able to determine if the tag search was performed.
    2) If the search was performed, call get_terms() and pass something like [ 'search' => $search_term, 'taxonomy' => 'post_tag' ] to the $args parameter.
    3) Output the results from that function which will be all the tags that match the query
    4) If you want to implement pagination, you could pass number and offset arguments to the $args parameter and implement a custom pagination.

    Hope that helps put you on the right path.

    Your best route is to carefully follow this guide. When you’re done, you may want to implement some (if not all) of the recommended security measures and start backing up your site.

    I hope you’re able to get the site restored quickly.

    Yes, that makes complete sense – thank you for the explanation @sangredeespana . I’m unfamiliar with Woocommerce, and this forum is focused on questions specific to Core WordPress functionality. I’d recommend starting a new thread on WooCommerce’s support thread, and somebody there should be able to help you out: https://wordpress.org/support/plugin/woocommerce/

    @cynicalwebsite I’m sorry to hear your host was hacked and it affected your website. That can be very frustrating.

    There’s a great explanation of recommended steps to take after a hack occurs at https://wordpress.org/support/article/faq-my-site-was-hacked/. You may have seen it already, but there may be some pointers there to get you up and running again.

    I would think that getting your host to restore the directory and get things back in order would be the easiest. If you feel confident about troubleshooting, you could set your wp-config.php file to display errors since you aren’t able to access your error logs. That may give you more insight to what’s going on (though be sure to revert the changes once it’s resolved). You can add the following lines to your wp-config.php file to view the errors instead of outputting to a log:

    define( 'WP_DEBUG', true );
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', true );

    Good luck and I wish you a speedy site recovery!

Viewing 15 replies - 76 through 90 (of 177 total)