Question and answer on Wordpress-15

12
SV 1338
3

Previous part of the topic .

A few remarks before the creation of the post in the topic. Compliance can help faster and better to get an answer.

  • Topeka Format: Ask a question, get an answer (option - press "thank you.";)). If your question requires more or less lengthy discussion - it makes sense to create a separate topic. So the discussion will be more visible, will not be lost in a series of other issues and you do not interfere with other members to find answers to their questions.
  • This is a topic for Wordpress. According to the CEO, HTML, CSS, JS, general security issues and etc please ask the relevant topics and sections sorcha.
  • To display small sections of code using bb-code [code] [/ code]. Large sheets put on http://pastebin.com , http://jsfiddle.net/ and TP services.
  • Before you ask a question like
    both of the links of the form "/? p = 123" to do "/ nazvanie-posta /"
    check out the admin VP and at least look at all the items. In most cases until you click "save" - will not change anything. Do not be afraid to try.
  • No need to "spasibnyh" posts (where only "thank you", no questions asked, and \ or descriptions of solutions and etc.) - it is a button. Plz do not clutter up the topic phony.

To all who are just starting to work with CAP recommend to read the article Beginners - Where to Start . Here you will get answers to questions like that you need to install WordPress , how to install WordPress and what to do next .

In general, this article has a lot of links that will be useful not only for beginners. I recommend to all.

In addition, it is possible that the question you want to ask - you will find the answer faster than write in the topic;)

The required minimum that should know and be able to admin the EP (and generally saytostroitel):

* Terms - headings record (positions), page saybar, widgets, tag \ tag, backup and so on. Do not just know the names, but to understand their nature and purpose.

* HTML - basic level (to study dozens of tags such as <p> or <img> - no great problem).

* View the source code of the page in the browser.

* Use search engines.

And also strongly recommend to forget about vindovyh notepad and edit the files in the right notebooks: AkelPad , Notepad ++ , and so. In UTF-8 without BOM.

If you want to really understand the engine (generally anyone, not just IP) and \ or have good and visit the site - you can not do without PHP knowledge, safety knowledge (as a network, and others even off-line.), Basic knowledge of communication protocols , basic knowledge of the servers, and much more .. what you need to spend a lot of time. (This is not intimidation, no - this is the advice warning)

And finally, useful resources on the EP:

Old and new * NEW codes - the main documents on the device and the work of the EP.

Generator different codes for AM .

WordPress at a glance " (an ex." An alternative view on WordPress) is an informal Russian-language documentation (free translation of the Code) of the EP with Pts. convenient search and filter it.

Roo forums: Of. ru-forum , another Russian forum .

English-language Q & A:

http://stackoverflow.com/

http://wordpress.stackexchange.com/

Additions to the EP:

Topics and plugins . Beginners strongly recommend taking only here. Why and what threatens garbage see n1 and here .

But those who want to know which sites can be made at the EP see the old (2009), but for the most part the actual topic Interesting websites on the EP (Skeptics might just pay attention to the part: The "High and visited sites on the WordPress") and the same year the post of 10 things you can do in addition to the WordPress blogging (many cores!)

Делаю хорошие сайты хорошим людям. Предпочтение коммерческим направлениям. Топики помощи с ⓌordPress ( /ru/forum/1019307 ) и основы безопасности сайтов ( /ru/forum/774117 ). *** Помощь\консультации в топиках форума - БЕСПЛАТНО. Платные услуги ( https://wp.me/P3YHjQ-3 ) - с бюджетом от 150$ ***
Avatar 77
#1

welcome!

The site is installed plugin RB External Thumbnail (External images for recording images.)

How to make XML to populate this field, or how to find out the name of the field to make a request?

Avatar 89
#2
sparsame:
external images

Not a good idea, it slows down the loading of the site.

sparsame:
how do you know the name of the field to make a request?

Name field thumbnail_external.

Avatar 77
#3
Gerga:
Not a good idea, it slows down the loading of the site. Name field thumbnail_external.

thanks for the response!

I send this xml. Fasting is created without errors, but the field with the image remains empty ..

I do not understand what I'm doing wrong ...

 <? Xml version = "1.0"?> 
<MethodCall>
<MethodName> metaWeblog.newPost </ methodName>
<Params>
<Param> <value> <array> <data>
<Value> <int> 0 </ int> </ value>
<Value> <string> my_login </ string> </ value>
<Value> <string> my_pass </ string> </ value>
<Value> <struct>
<Member> <name> title </ name> <value> <string> my_title </ string> </ value> </ member>
<Member> <name> description </ name> <value> <string>
my_description </ string> </ value> </ member>
<Member> <name> mt_allow_comments </ name> <value> <int> 0 </ int> </ value> </ member>
<Member> <name> mt_allow_pings </ name> <value> <int> 0 </ int> </ value> </ member>
<Member> <name> post_type </ name> <value> <string> post </ string> </ value> </ member>
<Member> <name> mt_keywords </ name> <value> <string> </ string> </ value> </ member>
<member> <name> thumbnail_external < / name> <value> <string> https: //my_site/image.jpg </ string> </ value> </ member>
<Member> <name> custom_fields </ name> <value> <array> <data>
<Value> <string> </ string> </ value>
</ Data> </ array> </ value> </ member>
<Member> <name> dateCreated </ name> <value> <dateTime.iso8601> my_data </dateTime.iso8601> </ value> </ member>
</ Struct> </ value>
<Value> <boolean> 1 </ boolean> </ value>
</ Data> </ array> </ value> </ param>
</ Params> </ methodCall>
Avatar 89
#4
sparsame:
I send this xml.

Not very clear where to send?

XML-file export standard WP means ( http://joxi.ru/vAWnykjtq5ql72 ) so about looks:


<? Xml version = "1.0" encoding = "UTF-8"?>
<Rss version = "2.0"
xmlns: excerpt = "http://wordpress.org/export/1.2/excerpt/"
xmlns: content = "http://purl.org/rss/1.0/modules/content/"
xmlns: wfw = "http://wellformedweb.org/CommentAPI/"
xmlns: dc = "http://purl.org/dc/elements/1.1/"
xmlns: wp = "http://wordpress.org/export/1.2/"
>

<Channel>
<Title> title </ title>
<Link> https://site.com </ link>
<Description> desc </ description>
<PubDate> Mon, 15 Jun 2020 08:41:24 +0000 </ pubDate>
<Language> en-US </ language>
....

<Item>
<Title> Australia </ title>
....
<Wp: post_id> 377 </ wp: post_id>
....
<Wp: postmeta>
<Wp: meta_key> <[CDATA [emoji_flag]]!> </ Wp: meta_key>
<Wp: meta_value> <[CDATA [value]]!> </ Wp: meta_value>
</ Wp: postmeta>
</ Item>
</ Channel>
</ Rss>

Avatar 77
#5
Gerga:
Not very clear where to send?

XML-RPC to add entries

Avatar 89
#6
sparsame:
XML-RPC to add entries

So I did not use, but according to the documentation , you are not properly filled in XML.


array custom_fields
struct
string key
string value


'Custom_fields' => [ [ 'Key' => 'thumbnail_external',
'Value' => 'https: //my_site/image.jpg',
]
]
HM 208
#7
sparsame:
I send this xml. Fasting is created without errors, but the field with the image remains empty ..

If thumbnail_external this custom field, it is necessary to send them to an array. xml not formiruesh hands, I hope?

Avatar 77
#8

thank! until it turns custom_field, but thank you for direction.

possible link in this case will Taxonomy, try

up_

the question at this point decided as follows:

- Dispatched xml rpc request to create a record, the ID of the new record

- by ID records are added to the database entry the desired url.

----

xml rpc I need for my job, so give it up in favor of full transition to database queries can not.

HM 208
#9
sparsame:
thank! until it turns custom_field, but thank you for direction.

Look now took from your poster on xmlrpc, add your custom field:

 <? Xml version = "1.0"?> 
<MethodCall>
<MethodName> metaWeblog.newPost </ methodName>
<Params>
<Param> <value> <array> <data>
<Value> <int> 0 </ int> </ value>
<Value> <string> admin </ string> </ value>
<Value> <string> passwd </ string> </ value>
<Value> <struct>
<Member> <name> title </ name> <value> <string> hello world title2 </ string> </ value> </ member>
<Member> <name> description </ name> <value> <string> hello world body2 </ string> </ value> </ member>
<Member> <name> dateCreated </ name> <value> <dateTime.iso8601> 20200615T14: 18: 04 </dateTime.iso8601> </ value> </ member>
<Member> <name> mt_allow_comments </ name> <value> <int> 0 </ int> </ value> </ member>
<Member> <name> mt_allow_pings </ name> <value> <int> 0 </ int> </ value> </ member>
<Member> <name> post_type </ name> <value> <string> post </ string> </ value> </ member>
<Member> <name> custom_fields </ name> <value> <array> <data>
<Value> <struct>
<Member> <name> key </ name> <value> <string> thumbnail_external </ string> </ value> </ member>
<Member> <name> value </ name> <value> <string> https: //my_site/image.jpg </ string> </ value> </ member>
</ Struct> </ value>
</ Data> </ array> </ value> </ member>
</ Struct> </ value>
<Value> <boolean> 1 </ boolean> </ value>
</ Data> </ array> </ value> </ param>
</ Params> </ methodCall>

It is formed as follows:

 $ Date = new IXR_Date (time ()); 

$ PostData = [ 'Title' => 'hello world title2',
'Description' => 'hello world body2',
'DateCreated' => $ date,
'Mt_allow_comments' => 0,
'Mt_allow_pings' => 0,
'Post_type' => 'post',
'Custom_fields' => [ [ 'Key' => 'thumbnail_external',
'Value' => 'https: //my_site/image.jpg',
]
]
];


$ Client = new WP_HTTP_IXR_CLIENT ($ url);
$ Client-> debug = false;

if (! $ client-> query ( 'metaWeblog.newPost', array (0, $ login, $ passwd, $ postData, true))) {
echo "err:". $ Client-> getErrorMessage (). "\ T";
return null;
}


---------- Posted 15.06.2020 at 17:38 ----------

sparsame:
- by ID records are added to the database entry the desired url.

If you suddenly want to do so (not clear why), it is possible through the wp-cli more:

usage: wp post meta add <id> <key> [<value>] [--format = <format>] or: wp post meta delete <id> [<key>] [<value>] [--all] or: wp post meta get <id> <key> [--format = <format>] or: wp post meta list <id> [--keys = <keys>] [--fields = <fields>] [- -format = <format>] [--orderby = <fields>] [--order = <order>] [--unserialize] or: wp post meta patch <action> <id> <key> <key-path> ... [<value>] [--format = <format>] or: wp post meta pluck <id> <key> <key-path> ... [--format = <format>] or: wp post meta update <id> <key> [<value>] [--format = <format>]
D 111
#10

How to install the plugin can cart to certain records? - they are informative articles, and selectively will need to add to them and cart page with information that the payment is in cash upon receipt of goods.

Вероятно, qip 634631357 и скайп взломан, пишите личные сообщения на форуме
12

To post a new comment, please log in or register