What is this HTTP_REFERRER “WordPress/4.1.2”

That log entry indicates the someone form that IP is requesting a image file from your site. The referrer “WordPress/4.1.2” indicates that it is probably using WP HTTP API, so the image is not just inserted in HTML (using <img> or any other HTML element) but requested server-side. Why? It can not be known with … Read more

Can i use init hook for API purpose?

If you want a more user-friendly URL structure, you could add a rewrite endpoint. This will add the rules for and intercept requests to /my-api/: function wpd_add_api_endpoint() { add_rewrite_endpoint( ‘my-api’, EP_ROOT ); } add_action( ‘init’, ‘wpd_add_api_endpoint’ ); function wpd_api_request( $request ){ if( isset( $request->query_vars[‘my-api’] ) ){ // $request->query_vars[‘my-api’] is a string containing everything after your … Read more

Save values generated via API as taxonomy terms

It’s as easy as: function wpse_199523_save_imdb_terms( $post_id ) { if ( ! $imdb = get_field( ‘imdb_id’, $post_id ) ) return; if ( ! $data = imdb_connector_get_movie( $imdb ) ) return; if ( ! empty( $data[‘actors’] ) ) wp_set_object_terms( $post_id, $data[‘actors’], ‘actors’ ); if ( ! empty( $data[‘director’] ) ) wp_set_object_terms( $post_id, $data[‘director’], ‘directors’ ); } … Read more

Use WordPress user database in external php application

If your main concern is using your WordPress database for user authentication, I’d look into the WP OAuth Server plugin. We use this for authentication with a 3rd party mobile app: app users type their username and password into the app which then – thanks to the plugin – authenticates them against their credentials in … Read more

Can an RSS item be altered with a hook?

the_content_feed is the hook I needed. In my case I am running a regex to replace relative URLs to absolute ones, so I added the following code to functions.php add_action(‘the_content_feed’, ‘relative_to_absolute_links’); function relative_to_absolute_links($content) { return preg_replace(“/(src=[‘\”]){1}\/{1}([^\/][^’\”]+)([‘\”])/im”, “$1” . get_site_url() . “/$2$3”, $content); }

Help using acf/save_post hook to connect to Untappd API and update_field [closed]

It’s because your require_once ‘Pintlabs/Service/Untappd.php’; is relative to “current” file and should be absolute path. I don’t know where are you using this hook but depending on location it should look something like this: ABSPATH is your wordpress root dir and ‘custom-path’ should be a path to Pintlabs dir require_once ABSPATH.’custom-path/’.’Pintlabs/Service/Untappd.php’; get_template_directory() if you use … Read more

How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?

I suggest you take a look at the Kirki toolkit: https://github.com/aristath/kirki It has a “repeater” field that should do what you need. It’s still under heavy development and for the time being I’ve only added the ability to use a few field-types with it, so I guess it depends on what exactly the data you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)