[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

oiksc_update_oik_hook() – Update the post data and meta data for an oik_hook post_type

Description

Update the post data and meta data for an oik_hook post_type

Usage

oiksc_update_oik_hook( $post, $hook, $context );

Parameters

$post
( post ) required – the oik_hook object
$hook
( mixed ) required –
$context
( mixed ) required –

Returns

void

TO DO

We need to stop cache invalidation occurring when this happens and the user is not logged in. Can we simple define( 'WPLOCKDOWN', '1' ) ? BUT we need to allow this logic to be performed when doing AJAX. The fact that the cache might be invalidated is probably OK.

Source

File name: oik-shortcodes/admin/oik-shortcodes.php
Lines:
1 to 37 of 37
function oiksc_update_oik_hook( $post, $hook, $context ) {
  if ( !defined( 'DOING_AJAX' ) && !is_user_logged_in() && php_sapi_name() !== "cli" ) {
    return;
  }
  $type = oiksc_get_hook_type( $context );
  $post->post_title = oiksc_oik_hook_post_title( $hook, $type );
  
  $docblock_obj = oiksc_load_docblock();
  if ( $docblock_obj ) {
    $docblock = oiksc_get_docblock( $docblock_obj );
    $params = oiksc_get_docblock_tags( $docblock_obj );
    $post->post_content = oiksc_build_oik_hook_post_content( $docblock, $params );
    
    $_POST['_oik_hook_docblock'] = $docblock;
    $_POST['_oik_hooks_params'] = $params;
  } else {
    $docblock = null;
    $params = null;
  }
  //$docblock = oiksc_get_docblock();
  // Don't change the post content but do change the _oik_hook_docblock field
  // 
  /* Set metadata fields */
  $_POST['_oik_hook_name'] = $hook;
  $_POST['_oik_hook_type'] = $type;
  
  $plugin = oiksc_get_plugin();
  $file = oiksc_get_filename();
  $_POST['_oik_hook_plugin'] = $plugin; 
  $_POST['_oik_hook_source'] = $file;
  oik_require( "admin/oik-files.php", "oik-shortcodes" );
  $_POST['_oik_fileref'] = oiksc_get_oik_fileref( $plugin, $file );
  
  
  //$_POST['_oik_hook_deprecated_cb'] = false;
  wp_update_post( $post );
}
 
 View on GitHub

Called by

1 to 1 of 1
  • _oikai_create_oik_hook() – Create an "oik_hook" post_type

Invoked by

    Calls

    1 to 9 of 9
    • oiksc_build_oik_hook_post_content() – Build the post content for an oik_hook //"$docblock<!–more –>[bw_fields][hooks]";
    • oiksc_get_docblock() – Return a formatted docblock
    • oiksc_get_docblock_tags() – Return the docblock tags for an action hook / filter
    • oiksc_get_filename() – Return the filename
    • oiksc_get_hook_type() – Return the hook type given the context
    • oiksc_get_oik_fileref() – Return the post_id for an oik_file
    • oiksc_get_plugin() – Return the post_ID for the plugin name
    • oiksc_load_docblock() – Build a docblock object from the most recent docblock
    • oiksc_oik_hook_post_title() – Set the post_title for an oik_hook

    Call hooks

    Function name: oiksc_update_oik_hook
    Plugin ref: oik block shortcode and API server
    Version: 1.41.5
    Sourcefile: admin/oik-shortcodes.php
    File ref: admin/oik-shortcodes.php
    Deprecated?: No
    API Letters: H,O,U

    Published: March 11, 2017 | Last updated: March 11, 2017

    Information

    Function name: oiksc_update_oik_hook
    Plugin ref: oik block shortcode and API server
    Version: 1.41.5
    Sourcefile: admin/oik-shortcodes.php
    File ref: admin/oik-shortcodes.php
    Deprecated?: No
    API Letters: H,O,U

    Recent plugin updates

    oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
    SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
    oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
    oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
    oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

    Plugins

    • All Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins

    Themes

    • FREE themes
    • Bespoke themes
    • Premium themes

    Blocks

    • All Blocks
    • Block examples
    • About Blocks

    Shortcodes

    • All Shortcodes
    • Shortcode examples
    • About Shortcodes

    Reference

    • About APIs
    • All APIs
    • All Classes
    • All Files
    • All Hooks

    Support

    • Contact
    • Cookies policy
    • Get API key
    • Privacy
    • Request support
    • Sitemap
    • Stay informed
    • Terms and Conditions
    oik-plugins
    Email: herb@bobbingwide.com

    Weight shipping plugins

    Find out which cart weight shipping plugin you need for your WooCommerce site.
    Which cart weight based plugin do I need?

    Site:  www.oik-plugins.com
    © Copyright oik-plugins 2011-2025. All rights reserved.


    Website designed and developed by Herb Miller of Bobbing Wide
    Proudly powered by WordPress and oik-plugins

    WordPress version: 6.8.3

    Gutenberg version: 21.7.0

    PHP version: 8.2.29