Forum Replies Created

Viewing 15 replies - 406 through 420 (of 564 total)
  • After some more searching, the reason why I had this working and now it does not is due to the up of the version of tinyMCE being used in WP. I found the answer here http://stackoverflow.com/questions/17491373/how-to-enable-meta-tag-in-tinymce-4-0

    using the code posted previously and adding the change from what I posted you get something like this:

    function schema_TinyMCE_init($in)
    {
        /**
         *   Edit extended_valid_elements as needed. For syntax, see
         *   http://www.tinymce.com/wiki.php/Configuration:valid_elements
         *
         *   NOTE: Adding an element to extended_valid_elements will cause TinyMCE to ignore
         *   default attributes for that element.
         *   Eg. a[title] would remove href unless included in new rule: a[title|href]
         */
        if(!empty($in['extended_valid_elements']))
            $in['extended_valid_elements'] .= ',';
    
        $in['extended_valid_elements'] .= '@[id|class|style|title|itemscope|itemtype|itemprop|datetime|rel],meta,div,dl,ul,ol,dt,dd,li,span,a|rev|charset|href|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur]';
    
        $in['valid_children'] = '+body[meta],+div[h2|span|meta|object],+object[param|embed]';
        return $in;
    }
    add_filter('tiny_mce_before_init', 'schema_TinyMCE_init' );

    and now we can add meta tags again.

    I thought I had this solved using something similar but I cannot stop WP from stripping out <meta> tags in content for those times when they are needed. Has anyone found a solution for this?

    I tracked this down to a setting in the wp-config.php file on the site.

    define('WP_CONTENT_URL', '/wp-content');

    This is a setting put there by the hosting provider. This isn’t really something that I can change.

    This plugin should be somehow be detecting if the url returned form plugins_url() includes the domain name and it should not be stripping off the beginning/ from the value it returns. This is the first plugin that I’ve found that has a problem with this.

    Unfortunately, I can’t even add a filter to put the ‘/’ back on because this plugin strips it off after the filters for plugin_url() are run and there in no filter in this plugin that would allow me to put it back on.

    Basically, while this may not effect a lot of people, my position is that this plugin should not be stripping the initial ‘/’ from the url returned by plugins_url().

    I have this installed on a testing site. This is the only plugin activated on the site. It is running a bare 2015 theme. This is the code that is output in the footer for this plugin on the admin page for this site.

    <script type='text/javascript' src='http://ssird5.com.php53-8.dfw1-2.websitetestlink.comwp-content/plugins/google-places-reviews/assets/js/form.js?ver=1.4.2'></script>
    <script type='text/javascript' src='http://ssird5.com.php53-8.dfw1-2.websitetestlink.comwp-content/plugins/google-places-reviews/assets/js/jquery.fitvids.js?ver=1.4.2'></script>
    <script type='text/javascript' src='http://ssird5.com.php53-8.dfw1-2.websitetestlink.comwp-content/plugins/google-places-reviews/assets/js/core.js?ver=1.4.2'></script>

    as you can see, there in no / between the domain name and wp-content

    Did this also fix the error in the script urls? the missing / between the site’s domain name and wp-content. I don’t think that has anything to do with google.

    Thread Starter John Huebner

    (@hube2)

    Finally got back to this and did some testing and recording.

    This is really long, so I posted the text on github as a gist here https://gist.github.com/Hube2/45a754828e5ffaee0ca123524c8f34b7

    There are a lot of image sizes on this site. I posted the before and after values of _wp_attachment_metadata. As you can see by looking at this, the last image size, “icon”, was not renamed.

    I also posted a list of all the image sizes on the site. I think that the file not naming is due to two images sizes that have the same image size file as a result.

    These image sizes are:

    • gallery-thumb (100×0)
    • icon (100×100 cropped)

    The first one creates a thumbnail that is 100 wide and proportional in height and the second crops the image to 100×100. As you can see by looking at the meta data, for his particular image these both result in an image that is 100×100 with the same file name.

    This is not the case with all images. When renaming images with a 4:3 ratio the problem occurs for all of the following image sizes, again they result in the same sized image and the same file name:

    • width-640 (640×0) & gallery-640 (640×480 cropped)
    • width-480 (480×0) & gallery-480 (480×360 cropped)
    • width-320 (320×0) & gallery-320 (320×240 cropped)

    Which is why this leads me to think that it has something to do with the cause.

    Thread Starter John Huebner

    (@hube2)

    Sorry for the confusion, but is seems I was mistaken on one part. The title of the file was “DANIEL.jpg” and this plugin renamed it to “daniel-jpg.jpg” so it wasn’t a case issue.

    But this does not clear up the problem with some of the image sizes in _wp_attachment_metadata not being properly updated. This is still happening which causes any image that I update to be broken in media list view.

    Thread Starter John Huebner

    (@hube2)

    Linux / Apache / PHP 5.6

    Linux file names are case sensitive.

    When testing I went to media, the first image listed has a file name of “DANIEL.jpg” and there is a button “Auto-Rename” and clicking this button changes the file name to “daniel.jpg”. Since linux in case sensitive I didn’t find this surprising.

    “icon” is an image size that is defined by the theme. I don’t know why the file name is not updated in _wp_attachment_metadata for some image sizes and not for others. I did some more testing and it’s not always the same image size that’s not renamed, however it does happen with this image size more than most. It could be that “icon” is (100×100 cropped) and there is another image size that is (100×0)… 100 width x any height. I can’t say for sure that’s the reason for sure, it’s just one theory.

    I was able to correct the problems with file name changes by using https://wordpress.org/plugins/ajax-thumbnail-rebuild/. After updating a file name I do a rebuild on the file and this causes all of the data in _wp_attachment_metadata to be updated correctly.

    Thread Starter John Huebner

    (@hube2)

    even more information, this is on the list view in the media library.

    and I tracked this down to the “icon” image size in _wp_attachment_metadata not being updated to the new file name.

    Thread Starter John Huebner

    (@hube2)

    More information. This has to do with letter case.

    For example if the image field name is XXXX.jpg and you click on the Auto-Rename the file name is changed to xxxx.jpg but the URLs put into the src and srcset attributes are still XXXX.jpg.

    Plugin Author John Huebner

    (@hube2)

    This plugin does not allow for pipes. To do what you’re doing I would use a combination of this plugin and my other plugin https://wordpress.org/plugins/contact-form-7-dynamic-mail-to/. This plugin would load the labels with values of post IDs like you are doing and then then other plugin would take that post ID, get the email address and send the email to that recipient.

    Plugin Author John Huebner

    (@hube2)

    Reading over your OP, I did see a problem with your setup, I’ll get tot that in a minute.

    You don’t need to copy both the class and the function from the examples file. The examples show the same thing done in two different ways for those that would rather work in a specific way. For example, I build with PHP classes an almost never use simple functions.

    The problem with your setup is that you want to base the email recipient on another field but you are not passing that field to the filter. this is referenced in this part of the instructions:

    If you would like the values of other fields sent to your filter as arguments, add a field with the name of “dynamic-mail-to-fields.” Set the value of this field to a comma separated list of the fields values you want sent to your filter. Again, see the example filter supplied with this plugin.

    Here is an example form using CF7 with the needed setup:

    <p>Your Name (required)<br />
        [text* your-name] </p>
    
    <p>Your Email (required)<br />
        [email* your-email] </p>
    
    <p>Subject<br />
        [text your-subject] </p>
    
    <p>Your Message<br />
        [textarea your-message] </p>
    
    <p>Select Email<br />
        [select select-email "send to email 1" "send to email 2" "sent to email 3"] </p>
    
    <!-- the name of the filter to use -->
    [simplehidden dynamic-mail-to-filter "wpcf7-dynamic-mail-to-example-filter"]
    <!-- the name of the select field to pass to the filter -->
    [simplehidden dynamic-mail-to-fields "select-email"]
    
    <p>[submit "Send"]</p>

    Plugin Author John Huebner

    (@hube2)

    The file cf7-dynamic-mail-to-examples.php in not included automatically by the plugin. The file is meant as an example of code you should put into your functions.php file.

    had the same problem. The urls for the scripts this plugin uses are being output like

    http://domain.comwp-content/plugins/etc....

    the / is missing after the domain name and before wp-content.

    As a temporary fix I changed line 154 of /classes/core.php from

    trim( $this->url, '/' ),

    to

    $this->url,

    Plugin Author John Huebner

    (@hube2)

    This plugin only handles simple select field choices and won’t do anything complicated like creating a hierarchical layout of choices, so I don’t think it will do what you’re looking for.

Viewing 15 replies - 406 through 420 (of 564 total)