Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter sqhendr

    (@sqhendr)

    Yeah, I found is_active_sidebar after sifting through others including is_dynamic_sidebar (also recommended by someone, but not really applicable here). I certainly understand the reason for not being intended for themes/plugins because of its private access. However, if it’s not intended to be used, it shouldn’t be listed on a page that lists functions to be used by developers. Especially if the page for wp_get_sidebars_widgets directs people to that page for alternatives.

    Seems like needless confusion and run-around, to me.

    Thread Starter sqhendr

    (@sqhendr)

    Seems to work quite well. Thanks for the update!

    Thread Starter sqhendr

    (@sqhendr)

    Hey,

    Glad to do so. All I changed was the get_cupp_meta function:

    /**
     * Retrieve the appropriate image size
     *
     * @param $user_id    Default: $post->post_author. Will accept any valid user ID passed into this parameter.
     * @param $size       Default: 'thumbnail'. Accepts all default WordPress sizes and any custom sizes made by the add_image_size() function.
     * @return {url}      Use this inside the src attribute of an image tag or where you need to call the image url.
     */
    function get_cupp_meta( $user_id, $size ) {
        //allow the user to specify the image size
        if (!$size){
            $size = 'thumbnail'; // Default image size if not specified.
        }
        if(!$user_id){
            $user_id = $post->post_author;
        }
    
        // get the custom uploaded image
        $attachment_upload_url = esc_url( get_the_author_meta( 'cupp_upload_meta', $user_id ) );
        // get the external image
        $attachment_ext_url = esc_url( get_the_author_meta( 'cupp_meta', $user_id ) );
        $attachment_url = '';
        $image_url = '';
        if($attachment_upload_url){
            $attachment_url = $attachment_upload_url;
            // grabs the id from the URL a WordPress function instead of the one originally proposed
            $attachment_id = attachment_url_to_postid( $attachment_url );
            // retrieve the thumbnail size of our image
            $image_thumb = wp_get_attachment_image_src( $attachment_id, $size );
            $image_url = $image_thumb[0];
    
        } elseif($attachment_ext_url) {
            $image_url = $attachment_ext_url;
        }
    
        if ( empty($image_url) )
            return;
    
        // return the image thumbnail
        return $image_url;
    }

    Essentially, I just changed the original call to get_attachment_image_by_url to attachment_url_to_postid. It seems like a pretty obscure WordPress function, so I hope it’s got good staying power.

    Thread Starter sqhendr

    (@sqhendr)

    Hey,

    Sorry, I would have responded earlier, but apparently WordPress’ email notifications aren’t working as I expected. I’m not sure what the etiquette is here. I’d be glad to send anyone a copy of the main plugin file that I changed. You’d just need to replace the 3five_cupp.php file with that one.

    The main thing to remember is that if the plugin is ever updated, that file will get overwritten. I’ve also not run a ton of tests on this change, so your mileage may vary, but it seems to be working well for me.

    I wanted to use multi-file upload in Gravity forms using this plugin, but it seems to be greyed out. Single file works just fine. Is this related?

    Thread Starter sqhendr

    (@sqhendr)

    Ok, looks like WordPress doesn’t like post types that are mass nouns rather than count nouns. I had capabilities for which the singular and plural were the same. Thus, the capability type was an array (‘mytype’,’mytype’). I changed it so that it actually has an “s” plural in the capabilities, and it works. It makes my inner grammarian squirm, but it works.

    Thread Starter sqhendr

    (@sqhendr)

    This was done using XCloner, to package up the database and files. However, we’ve recently found that some of its database functions are little questionable. That may be part of the issue, and we’re going to try to do just a straight mysqldump and tar of the production files and then set it up on the dev server. I’m not really thinking that’s the issue, but at this point, who knows?

    Generally, we’ve got the virtualhosts all set up, and they work well for what we’re doing, which is not all that sophisticated. It’s just a clone of the site on a different server/domain. I modified the wp-config.php to use the new DB and modified it with the appropriate domain.

    I’ve also used Velvet Blues Update URLs to update the post and page content urls, which works as expected.

    I’m having the same issue, it seems. I’m not even getting any new posts created at all.

    Thread Starter sqhendr

    (@sqhendr)

    Good to know, I’ll let my content editors know. Thanks!

    Thread Starter sqhendr

    (@sqhendr)

    Brilliant! Thanks for getting to that so quickly. I’ll get that on our next update cycle!

    Thread Starter sqhendr

    (@sqhendr)

    I guess what I mean is that the scripts that initialize selectize and chosen are enqueued with jquery as a dependency. Seems like the trick will be enqueueing them with the appropriate selectors or just having the script call on any of the possible selectors, even if they’re not necessary.

    Thread Starter sqhendr

    (@sqhendr)

    It looks as if jQuery is being loaded after this script, rather than before. I wonder if it might be better to put this in a script that runs on document.ready(), rather than at the moment the interface is created.

    Thread Starter sqhendr

    (@sqhendr)

    That’s great! I’ll update the plugin and give that a try. Thanks!

    Thread Starter sqhendr

    (@sqhendr)

    Just an update: it appears that the filter does not work. It would be great if there was a way to change that setting somewhere so that it wasn’t necessary to update the code manually every time there’s an update for the plugin.

    Thread Starter sqhendr

    (@sqhendr)

    Great, thanks! I’ll use the filter to get that active.

Viewing 15 replies - 1 through 15 (of 19 total)