How to use get_option() without any filter?

I’m guessing that you are using language tags around ‘polish textdeutschland text’ i.e. <!–:pl–>polish text<!–:–><!–:de–>deutschland text<!–:–> but that they got ignored when you posted your answer. I’m pretty sure what you need to be doing is using the __() (which returns the translation for use in php code) and _e() (echo’s direct to screen) wordpress … Read more

is_home doesn’t affect content

You need to is is_front_page() instead of is_home(). is_home() actually refers to the blog page (or the home page if you have it set to show latest posts). is_front_page() refers to the page (regardless of whether it is a static page or a latest posts feed) that sits on the front of your site.

The correct way to call posts with ajax

As @MatthewBoynes already stated, making a $.post() request for every image might bring some overhead. A maybe better solution would be to grab and cache them, then throw them into your js files using wp_localize_script(). $attachments = get_posts( array( ‘post_parent’ => get_the_ID() ,’post_type’ => ‘attachment’ ,’posts_per_page’ => -1 #,’exclude’ => get_post_thumbnail_ID() // only needed if … Read more

Check if username exist with AJAX

The problem is with your jQuery selector: var usr = $(“#site-addres-input”).attr(‘value’); Will get the default value of the input element. Typically this will be blank, because you’re not setting it ahead of time. You need to use: var usr = $(“#site-addres-input”).val(); I’m also noticing that you’re using #site-addres-input, but “address” has two s at the … Read more

Is it safe to post form data via Ajax to the settings api? Am I missing something?

WordPress does not natively use Ajax submits with Settings API, so there isn’t really best practice for it. I remember scbFramework having such option, but it was removed. Essentially there is nothing inherently more insecure to such submit, you should treat form data as untrusted regardless of submit method and appropriately sanitize and validate it … Read more

update_user_meta doesn’t work with AJAX

First You can get rid of nasty globals in your AJAX call. I’m not sure what the $st variable that you were output is all about so I’ve excluded, but you can include as you wish – add_action(‘wp_ajax_change_subscription’, ‘change_subscription’); function change_subscription(){ if(!empty($_POST[‘term_id’]) && !empty($_POST[‘type’])) : $user_id = get_current_user_id(); update_user_meta( $user_id, ‘hannit_meta’, ‘My Value’ ); endif; … Read more

query vars in url work but not in ajax call

That’s not the right way to specify data. When you’re using jQuery AJAX, you specify data as an array or an object when passing it in to the method. In your question, it seems like ‘filters_get’ === ‘?actor=x&’ Instead, you should do the following: filters_get = { ‘actor’: ‘x’ }; $.ajax({ url: templatePath + “getmovies.php”, … Read more

How to use JSONP to make AJAX request to different site on network

There’s two parts to this, the javascript ajax call needs specific variables included: $.ajax({ type: “GET”, url: SSL_Ajax.ajaxurl, cache: false, dataType: “jsonp”, crossDomain: true, data: { action : ‘ajaxSSL’, ajaxSSLNonce : SSL_Ajax.ajaxSSLNonce, input : $(‘input[name=title]’).val() }, success: function( data ) { console.log( ‘success’ ); console.log( data ); }, complete: function( data ) { console.log( ‘complete’ … Read more

Ajaxing function in widget class

If this is in a widget class, you need… add_action(‘wp_ajax_my_func’, array($this,’my_func’)); … not just… add_action(‘wp_ajax_my_func’, ‘my_func’); However, I suspect there to be more problems than just that due to the context you are using this in. But without more code, that is all I’ve got. Based on new information in the question… Both your function … Read more