Try applying these and your code might work:
-
Looking at the expressions
$type_of_running == 'manually_run'
and$type_of_running == 'planned_run'
, where you’re expectingget_post_meta()
to return a single meta value, you should then set the 3rd parameter totrue
:// Set the 3rd param to true to get a single meta value. $type_of_running = get_post_meta($post_id, 'spusteni_dotazovani', true);
-
metadata_exists()
requires 3 parameters, i.e. the meta type (e.g.post
for post meta orterm
for term meta), the “object” ID (e.g. post ID or term ID) and the meta key, so make sure you pass the correct parameters like so:if(metadata_exists('post', $post_id, 'datum_a_cas_planovaneho_spusteni')) { delete_post_meta($post_id, 'datum_a_cas_planovaneho_spusteni'); }
and
if(metadata_exists('post', $post_id, 'running_status')) { delete_post_meta($post_id, 'running_status'); }
Related Posts:
- Allow a particular user to access a particular plugin?
- admin_notices show after load completed
- Prevent WordPress from sending set-cookie http header
- Cookie value changes back to previous value after changing
- Change plugin descriptions
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- How use wp_insert_post and add og:custom tags?
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- The Build menu theme is frozen with the wordpress theme
- Problem with checked box on wp car manager plugin
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- Why is my shortcode not working?
- WordPress rewrite rule depend on meta values not ids
- Rename a folder via HTML POST request
- How to change “Read More” text?
- How to translate to spanish wordpress hardcoded content/files?
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- update_post_meta is not working for me when I use e.preventDefault for update button
- How can I see $post object in frontend from functions.php?
- Move plugin pages from dashboard to front-end
- working code, not working – Plugin Dev
- SimpleXML is not working with xml response from external api
- How to use Datatable with Ajax when creating plugin on WordPress?
- WordPress plugin blog creation
- Problem with wordpress has_action() function
- Offering a freemium plugin (a free version + paid version)
- Using id to show item
- Multiple image selection custom widget
- implement checkbox or toggle switch in plugin code
- 500 Internal server error wp_handle_upload_prefilter
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Change Woo Custom Endpoint Titles from a Plugin
- Create a form and have custom menu display based on user answers?
- Showing how many times is plugin activated or deactivated
- Can’t access 3rd party API, code works on local server but not on wordpress
- Plugin Breaking WordPress Login
- How to get site homepage from plugin?
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- Undefined variable _POST
- Help me with my first very basic plugin
- Load my plugin before cache
- How use Dynamic hyperlink on each wordpress post?
- Unable to show 4 products in a row
- How to fix ‘Call to undefined function do_settings()’ error?
- What is the source outline for a basic word press plugin?
- My wordpress website admin panel loads very slow, what can i do about that? [closed]
- Submit posts in two different post types with the same form
- wordpress select multiple options and illegal string offset ‘timeslot’ [closed]
- how to search through plugin in wordpress cimy-user-extra-fields?
- How to create post comparison in wordpress
- What can I do to customize a widget provided with this plugin? from where have I to start?
- How to add custom html to the Media > Attachment Details modal?
- Displaying Category Feature image on loop
- Function not being called on form submit, only blank admin-post.php page
- wp_handle_upload – specified file failed upload test
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How to override plugin function in code snippets WordPress
- How to make a Template page to show the information of different things Shop and Product page?
- How to create a “Most Popular” & “Latest” TAB in WordPress
- How to trigger plugin migration code when plugin updates?
- How to Save Category and Delete Category in same Function
- WordPress Throwing Deprecated Errors on its own Files
- public custom posts not showing in my wordpress plugin
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class
- plugin doesn’t retrieve data from database
- Accessing Correct Database to Create REST API Endpoint
- Mixed results with is_page() WordPress function, when using $this, or self
- add_action() not working for admin
- REST API – filters not working inside plugin class
- Read page- or post-content across different builder-plugins
- How to make WordPress Plugin run on single specific Admin Page
- WordPress site server getting blocked due to resource abuse
- Error 400 Invalid “products[1].productId” Kinguin [closed]
- Plugin question, How to insert a colon in a value box
- Woocommerce attatch files and custom input meta to cart items and then to order
- How to add usermeta for existing users when user profile is updated
- wp_head filter not executed inside custom class
- redirect logged users to custom front-end insetad of wp-admin
- How to fetch WordPress Gallery Images to a Custom Post Type?
- Remove custom menu pages for admin users
- Custom uploader – Upload files and save link into database
- Implement Google SSO in custom plugin
- Unable to use correctly composer autoload in plugin file
- I have issue to retrive post thumbnail with rest api
- Custom block based off core block using filter
- Remove H1 title in admin post edit screen
- Custom plug-in issues
- Custom Search Function in WordPress Returns No Results
- Call to undefined function create_function() – PHP 8.2
- can not serialize and insert data from custom form
- Custom page template from plugin does not work with pre-installed themes in WordPress 6.6.1
- Custom Dynamic Tag in Elementor not showing image