Comparing your code to the WordPress function wp_schedule_single_event, it appears you failed to indicate that parameters would be passed.
Perhaps the following version of your code will work for you.
add_action( 'crondelete', 'delete_page_in',10,1);
wp_schedule_single_event($seconds, 'crondelete', array($new_post_id ));
Notice the add_action now includes two extra parameters: 10=Priority, and 1=Accepted Arguments to be passed.
Related Posts:
- How to run a function every 5 minutes?
- Do WordPress’ cron’s clean up expired transients?
- Automated mark posts as featured every day
- WP_Cron doesn’t do the job: Multisite stats
- Create cron job for update translations automatically
- WordPress function, Run using Crontab
- Display a random tag but using cron to control frequency of change
- Bulk updating a group of WordPress Pages every 10 minutes
- Writing a function for WP Cron to run a SQL command daily
- Deleting guests profile users after 1.5 hours
- Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
- Working function() doesn’t execute when triggered by WP CRON
- Update post meta with wp cron
- HELP: Code To Check Status And Write Debug Entry
- How to override parent functions in child themes?
- Solution to render Shortcodes in Admin Editor
- Define page template in wp_insert_post
- Get a list of all available fields in the User Profile
- How do I use the WP image functions in a page template?
- How to remove Customize from admin menu bar after WP 4.3
- Child theme functions.php do I use php open and close tags?
- Modify Admin Bar Link
- why doesnt is_home() work in functions.php
- WP 4.4. responsive loads normal image after loading the responsive image
- Enabling shortcodes for custom fields
- Passing variables to templates (alternatives to globalizing variables)
- Load post with a different template?
- How can I tell if I’m on a login page? [duplicate]
- Dynamically Register Sidebars For Each Top Level Page
- Two different menus for two different locations?
- Error after editing functions.php
- Run Product Filter Javascript On Page Template
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- How to add a column to the Trash page?
- Images uploaded using media uploader are appearing upside down
- Empty Date Returned on my function
- Woocommerce Attributes pulling in wrong data
- How to get the post_name when in preview?
- “is_new_day()” alternative for years?
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- How to hook into a function offered by a plugin?
- Echo tags used to describe the theme
- How to Display Frontend CSS for Administrator only
- How can I change a function in a parent theme via a child themes functions.php
- How can I remove the main description text box in a Woocommerce product editor page? I only use the “Product short description” text box [closed]
- Automatically assign video ‘poster’ value to ‘filename’ for archive listing
- How can I make a widget shortcode to control all the widgets?
- admin-ajax.php + load-scripts.php hanging for minutes
- Unique sequential reservation code
- Where to add the permalink in this function?
- Show image exactly defined to a width
- Always the Latest google jQuery instead of default WordPress jQuery
- Function to display post by specific author
- Override the WordPress core function wp_referer_field
- Is `is_sidebar_active()` deprecated, and showing error?
- How to return hook data when multiple parameters are present?
- Return category name with & Ampersand doesnt work
- Control the srcset much more (not all sizes in it each time)
- How to add_filter html template to middle of content
- Warning: join(): Invalid arguments passed in post-template.php
- Some questions about how proper add 2 CSS file in a WordPress theme?
- is_page() or is_single not working
- What are the meta fields for an attachment?
- Can’t locate custom image sizes defined by child theme
- How to map numbers utilizing array function
- how to change “posted by” words
- Add attribute only to first image of every post via functions.php
- 400 Bad Request – JavaScript App calling Custom wp-json endpoint
- Add loggedout class on body using a function or JS
- Help with IF has focus then… statment
- How d0 i get the number of attachments in the post
- Default click “I have read and agree to the website terms and conditions”
- How to use wp_enqueue_script properly?
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Run function with schedule is not working correctly
- Enqueue script if not page template
- How do you insert code into the sidebar?
- Test CDN link from function.php or wp_enqueue_script/style?
- Auto Resize embedded videos player
- Auto remove tags on certain date
- get_field() with ID in one signal filter not working
- i can’t use wordpress functions in ajax loaded php file
- Woocommerce – Switching Price for Category
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- How to create a WordPress Customizer Button to Clear a Cache?
- Is there any requirements to do socket programming with WordPress?
- Adding A New Widget to WordPress Disables the Existing Widgets
- Javascript and Stylesheet in child page
- Call custom field using php
- Problem in outputting shortcode
- add_theme_support not outputting thumbnails
- How to get tags and categories?
- Archive.php, and post_is_in_descendant_category
- update_user_option not working as expected
- Having problems loading Jquery in functions.php
- How do I access variables outside a function [closed]
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Retrieving next_post_link() and previous_post_link() in functions.php
- Get all users from role and add to dropdown (select) – wordpress, javascript
- WordPress enque the same script causes the setInterval not to work