Support » Fixing WordPress » Add media button non fuction

  • Resolved daisytai

    (@daisytai)


    !function(a){function b(){var b,d=a(“#wp-auth-check”),f=a(“#wp-auth-check-form”),g=e.find(“.wp-auth-fallback-expired”),h=!1;f.length&&(a(window).on(“beforeunload.wp-auth-check”,function(a){a.originalEvent.returnValue=window.authcheckL10n.beforeunload}),b=a(‘<iframe id=”wp-auth-check-frame” frameborder=”0″>’).attr(“title”,g.text()),b.on(“load”,function(){var b,i;h=!0,f.removeClass(“loading”);try{i=a(this).contents().find(“body”),b=i.height()}catch(j){return e.addClass(“fallback”),d.css(“max-height”,””),f.remove(),void g.focus()}b?i&&i.hasClass(“interim-login-success”)?c():d.css(“max-height”,b+40+”px”):i&&i.length||(e.addClass(“fallback”),d.css(“max-height”,””),f.remove(),g.focus())}).attr(“src”,f.data(“src”)),f.append(b)),a(“body”).addClass(“modal-open”),e.removeClass(“hidden”),b?(b.focus(),setTimeout(function(){h||(e.addClass(“fallback”),f.remove(),g.focus())},1e4)):g.focus()}function c(){a(window).off(“beforeunload.wp-auth-check”),”undefined”==typeof adminpage||”post-php”!==adminpage&&”post-new-php”!==adminpage||”undefined”==typeof wp||!wp.heartbeat||(a(document).off(“heartbeat-tick.wp-auth-check”),wp.heartbeat.connectNow()),e.fadeOut(200,function(){e.addClass(“hidden”).css(“display”,””),a(“#wp-auth-check-frame”).remove(),a(“body”).removeClass(“modal-open”)})}function d(){var a=parseInt(window.authcheckL10n.interval,10)||180;f=(new Date).getTime()+1e3*a}var e,f;a(document).on(“heartbeat-tick.wp-auth-check”,function(a,f){“wp-auth-check”in f&&(d(),!f[“wp-auth-check”]&&e.hasClass(“hidden”)?b():f[“wp-auth-check”]&&!e.hasClass(“hidden”)&&c())}).on(“heartbeat-send.wp-auth-check”,function(a,b){(new Date).getTime()>f&&(b[“wp-auth-check”]=!0)}).ready(function(){d(),e=a(“#wp-auth-check-wrap”),e.find(“.wp-auth-check-close”).on(“click”,function(){c()})})}(jQuery);

    Where’s the error?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Uncaught TypeError: Cannot read property ‘interval’ of undefined

    The error is on line 47, see https://gist.github.com/aubreypwd/6b78f5e3a756725e9d9dc8f4acfa7838#file-where-s-the-error-L47

    var a = parseInt(window.authcheckL10n.interval, 10) || 180;

    authcheckL10n is not a defined variable. WordPress uses wp_localize_script to define variables like this in PHP. I suspect you’ve deactivated a plugin that created this variable, or it has some special checks and isn’t getting defined on the page you are seeing this error on.

    BTW, this is a horrible way to ask for support as you are offering entirely no context.

    Excuse me , but it’s the first time I write.
    I have the follow code:

    function wp_localize_script( $handle, $object_name, $l10n ) {
    global $wp_scripts;
    if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    return false;
    }

    return $wp_scripts->localize( $handle, $object_name, $l10n );
    }

    That is WordPress’s function that creates the variable, do not make any modifications to WordPress Core files.

    What you want to look for (in your search) is probably: 'authcheckL10n' (with the tick marks). That should help you find the place where they use that function to create that variable.

    It may looks something like this:

    wp_localize_script( 'some-script-handle', 'authcheckL10n', array(
    	'interval'       => 10,
    ) );

    But I suspect you won’t be able to find it as it appears the code is missing.

    I don’t find in wp-includes/functions.wp-scripts.php your suggestion

    First off I would stay out of anything outside of the wp-content folder. Stick to the wp-content folder for finding the issue on your own. Again, I’m fairly sure that the code is now missing.

    What is the actual error you are having? Why did you post your first post, what is the issue you are having? Can you take some screenshots of what you’re seeing?

    I find only

    function wp_localize_script( $handle, $object_name, $l10n ) {
    global $wp_scripts;
    if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    return false;
    }

    return $wp_scripts->localize( $handle, $object_name, $l10n );
    }

    Again, that is a WordPress core file and should not be modified. It is outside of the wp-content folder. That is not what you are looking for, please see my previous response.

    Don’t fuction “add media button” when I create a new post

    You’re going to have to provide some screenshots with your responses.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add media button non fuction’ is closed to new replies.