wordpress-plugin

Wordpress, add custom button on post type list page

我只是一个虾纸丫 提交于 2020-07-08 07:01:15
问题 I am trying to add custom button on top of post type page like this image Is there any filter or action I can use to add custom button there? Thanks 回答1: I found a way to get it done but I am not very happy with this procedure. Please add your answer if you find better way. Mean while, this might be of help. add_action('admin_head-edit.php','addCustomImportButton'); I only need this on edit page, so I am using admin_head-edit.php action, but you can use admin_head or some other (not very

Wordpress, add custom button on post type list page

空扰寡人 提交于 2020-07-08 06:59:40
问题 I am trying to add custom button on top of post type page like this image Is there any filter or action I can use to add custom button there? Thanks 回答1: I found a way to get it done but I am not very happy with this procedure. Please add your answer if you find better way. Mean while, this might be of help. add_action('admin_head-edit.php','addCustomImportButton'); I only need this on edit page, so I am using admin_head-edit.php action, but you can use admin_head or some other (not very

Wordpress custom post type capabilities, admin can't edit post type

谁说我不能喝 提交于 2020-06-25 05:46:30
问题 I'm having a wired problem with WordPress. Below is my code for an events post type, it works without the capabilities but when the capabilities are added all the default roles (admin, editor, etc...) cant use the post type. The admin role is only able to see the custom taxonomies. I have a custom user role with "edit_events => true" for the user role that is able to submit events for review. This is what I want, but the built in roles can't see the post type! I've tried just about every

Change user role via URL [WordPress]

好久不见. 提交于 2020-03-21 05:44:43
问题 I'm creating plugin which will register all new users as role = unverified and stop user from login until email verification. I want to send url on their email which will change the current unverified role to author. I know how to send email etc all of that in WordPress but can't figure out how to create url which will change the role. I'm using custom ajax form to login,register and lostpassword because of it i'm unable to use pie register and register-plus-redux plugins. Current code

Change user role via URL [WordPress]

血红的双手。 提交于 2020-03-21 05:44:06
问题 I'm creating plugin which will register all new users as role = unverified and stop user from login until email verification. I want to send url on their email which will change the current unverified role to author. I know how to send email etc all of that in WordPress but can't figure out how to create url which will change the role. I'm using custom ajax form to login,register and lostpassword because of it i'm unable to use pie register and register-plus-redux plugins. Current code

Calling a function after a click on a button in Wordpress (dev-plugin)

ぃ、小莉子 提交于 2020-03-05 15:11:09
问题 This is my code and I wanna do what is commented near line 73 (//HOW CAN I CALL FUNCTION post_type_search_callback HERE???). The results need to be in the same page, below the "form". I was trying some tutorials about ajax in the web but without succeeded. Pls help! Thanks! <?php class OwnersTriplify { const plugin_name = 'Owners-triplify'; public static function head() { } public static function initialize() { add_action('admin_menu', 'owners_triplify_admin_actions'); function owners

How do I set a cookie in a wordpress ajax request handler?

时光毁灭记忆、已成空白 提交于 2020-02-28 05:53:29
问题 I am trying to set a cookie in a wp ajax request handler without any success. Hope someone can help me. Here is client-side code: var foo = $('#foo'); $.ajax({ url: 'http://127.0.0.1/wordpress/wp-admin/admin-ajax.php', type: 'post', dataType: 'json', cache: 'false', data: { 'action' : 'foo', 'foo' : foo.val(), 'nonce' : foo.data('nonce') }, success: function(data) { console.debug(data) }, error: function() { console.error('fail') } }); Here is the plugin: function foo() { check_ajax_referer(

Visual Composer custom markup for custom shortcode (vc_map)

北慕城南 提交于 2020-02-20 10:51:51
问题 Trying to get custom_markup to work with the Visual Composer builder for WordPress. Found Visual Composer change custom shortcode template and also Visual Composer custom shortcode template - custom_markup display user input but none of them has an answer. Here's some documentation for the vc_map function https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524332 Here's my shortcode that I'm using, everything works perfectly, it just looks horrible in the backend ui vc_map( array

Visual Composer custom markup for custom shortcode (vc_map)

不羁的心 提交于 2020-02-20 10:51:06
问题 Trying to get custom_markup to work with the Visual Composer builder for WordPress. Found Visual Composer change custom shortcode template and also Visual Composer custom shortcode template - custom_markup display user input but none of them has an answer. Here's some documentation for the vc_map function https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524332 Here's my shortcode that I'm using, everything works perfectly, it just looks horrible in the backend ui vc_map( array

Calling a function in a custom php template in Wordpress

前提是你 提交于 2020-02-02 19:57:27
问题 I want to call a function which is in another php class that I wrote in Wordpress. However I'm confused about the syntax, e.g. to get the header on a page you just call get_header(); etc. But how do i call a function in a specific class? For example in index.php I want to call a function named this_function() which reside in say test.php. What is the syntax for this? I suspect it to be very simple, but I can't get the syntax right, and I can't any help online. Thanks 回答1: First use require