Why does my media selection script write to ONLY the first input field?

this problem is because of the first “if”, the good text field in only set the first time to change that, you can add a “data” arguement in HTML and change the JavaScript code like that (look the modification in meta_image_frame.on(‘select’…) (function($) { ‘use strict’; $(function() { var meta_image_frame; function saveImage(e, uiElement) { e.preventDefault(); if … Read more

Get value of submit button in custom post type

I woke up and had a revelation, as you do… WordPress was using Javascript to prevent the action of the submit buttons to make an ajax call instead. Turning off Javascript solved my problem. Now I can move on to the Javascript enhancement of my own.

WordPress CPT Url metabox collection

you can add a parameter with a new rewrite rule like that : add_action(“init”, function () { add_rewrite_tag(“%countryName%”, “([^&]+)”); add_rewrite_rule( “^company/([^/]*)/country/([^/]*)/?” , ‘index.php?company=$matches[1]&countryName=$matches[2]’ , “top” ); }); After adding this code, flush the rewrite rules of WordPress. Then you can use URL like http://example.com/company/company-abc/country/UK And then in the template, you retrieve the parameter with get_query_var(“countryName”, … Read more

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