evbof7734 on "[Plugin: WordPress Access Areas] Creating Post via code"

ساخت وبلاگ

evbof7734
Member
Posted 11 hours ago #

I am writing a widgit that inserts a post into a protected area (only one special user can edit)
However, I am rather new to php.
Right now, my assumption is that as I build $post I will need to do something like:
'post_edit_cap' => ??????
but I have no idea what ?????? should be.
I tried
'post_edit_cap' => get_user_label ("userlabel_1_uncleprotected")
but that did not work. Upon further examination I am not surprised it did not work. As I mentioned, I am very new to php. Based on limited knowledge it seems to me that post_edit_cap is more than a mere integer.
Can you help me on this? Not only would you be helping me with your own plugin, you would also be giving great insight into php for a noob.

https://wordpress.org/plugins/wp-access-areas/

I have continued to fiddle with things.
I am at this point and I am stymied.
I have setup a $post with an author, contents, and all that jazz. I then try the following:

$post['post_edit_cap'] = 'userlabel_1_uncleprotected'; $post_id = wp_insert_post($post);

I have also tried double quotes.

evbof7734
Member
Posted 11 minutes ago #

It would seem I had set all my post array incorrectly.
I have a very basic button working right now.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 200 تاريخ : سه شنبه 25 خرداد 1395 ساعت: 10:40