bengt1234
Forum Replies Created
-
Great, thanks!
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] Calling [adverts_list] from code in themeGreat, thanks!
Hi, there is one thing more that doesn’t work correctly, this code in list.php:
echo paginate_links( array( 'base' => $paginate_base, 'format' => $paginate_format, 'current' => max( 1, $paged ), 'total' => $loop->max_num_pages, 'prev_next' => false ) );
$paginate_base is wrong for custom taxonomies, it uses the adverts root as base, not the custom taxonomy base. It works for advert_category so there is something that needs to be added for new taxonomies. Do you know what it might be?
Thanks, it works perfectly.
Forum: Hacks
In reply to: Create a new post with XML-RPC creates wrong value for GUIDFound a solution!
$my_page_ask = array( 'link', 'guid' ); $params = array(0,$username,$password,$my_page_id, $my_page_ask); $clientresult = $client->query('wp.getPost', $params); $post = $client->getResponse(); var_dump($post);
string link contains the correct permalink!
Forum: Hacks
In reply to: Create a new post with XML-RPC creates wrong value for GUIDMaybe it is working as intended, but it is kind of annoying. I have tested get_the_permalink() but it only works if $my_page[“post_status”] = “publish”; I was planing to use draft, but then get_the_permalink() report https://test/site/?p=12721.
I can use publish but I cant use get_the_permalink() on another wordpress installation. The plan is:
mainserver > wp.newPost > server2 > site1, site2, site3 etc
mainserver > wp.newPost > server3 > site4, site5, site6 etcmainserver > wp.getPost > guid > site1
mainserver > wp.getPost > guid > site2
etcThe mainserver needs to know the correct permalink for every article that is published on all sites. So it can send the permalink to every site in the network. I then use it it for crosslinking and hreflang tag. All sites in the network are in different languages.
When I ask site1:
$params = array(0,$username,$password,$my_page_id); $clientresult = $client->query('wp.getPost', $params); $post = $client->getResponse(); var_dump($post);
Result:
array(25) { ["post_id"]=> string(5) "12800" ["post_title"]=> string(18) "Name" ["post_date"]=> object(IXR_Date)#5412 (7) { ["year"]=> string(4) "2016" ["month"]=> string(2) "09" ["day"]=> string(2) "23" ["hour"]=> string(2) "09" ["minute"]=> string(2) "37" ["second"]=> string(2) "05" ["timezone"]=> bool(false) } ["post_date_gmt"]=> object(IXR_Date)#5411 (7) { ["year"]=> string(4) "2016" ["month"]=> string(2) "09" ["day"]=> string(2) "23" ["hour"]=> string(2) "05" ["minute"]=> string(2) "37" ["second"]=> string(2) "05" ["timezone"]=> bool(false) } ["post_modified"]=> object(IXR_Date)#5394 (7) { ["year"]=> string(4) "2016" ["month"]=> string(2) "09" ["day"]=> string(2) "23" ["hour"]=> string(2) "09" ["minute"]=> string(2) "37" ["second"]=> string(2) "06" ["timezone"]=> bool(false) } ["post_modified_gmt"]=> object(IXR_Date)#4980 (7) { ["year"]=> string(4) "2016" ["month"]=> string(2) "09" ["day"]=> string(2) "23" ["hour"]=> string(2) "07" ["minute"]=> string(2) "37" ["second"]=> string(2) "06" ["timezone"]=> bool(false) } ["post_status"]=> string(7) "publish" ["post_type"]=> string(4) "post" ["post_name"]=> string(30) "es-espana-top-car-autoreisen-2" ["post_author"]=> string(1) "1" ["post_password"]=> string(0) "" ["post_excerpt"]=> string(399) "Test" ["post_content"]=> string(3492) "
I need site1 to send the correct permalink back. But I cant find any way to make that work.
Forum: Hacks
In reply to: Create a new post with XML-RPC creates wrong value for GUIDI would call it a bug, not a major one but its is an inconsistent behavior. It doesn’t really matter for wordpress because it doesn’t effect any wordpress functionality. But it causes problems for hacks and plugins.
get_the_guid and $wp_post_data->guid don’t work as expected for posts created with XML-RPC. They report the wrong URL.
I have tested:
$wp_post_data = get_post($my_page_id); $wp_slug = $wp_post_data->post_name; $my_page_update = array(); $my_page_update["guid"] = "https://test/site/".$wp_slug."/"; $params = array(0,$username,$password,$my_page_id,$my_page_update); $clientresult = $client->query('wp.editPost', $params);
But it doesn’t work.
The only solution I can find is to use raw sql:
UPDATE wp_posts SET guid='"https://test/site/".$wp_slug."/"' WHERE ID=".$my_page_id .";
Not something I would like to do, but I have no choice at the moment. I use get_the_guid and $wp_post_data->guid in a my plugins and I need them to report the correct URL.