
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: class.setting.post.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

if ( ! defined( &#039;ABSPATH&#039; ) ) {
  exit;
}

if ( ! class_exists( &#039;MywpSettingPost&#039; ) ) :

final class MywpSettingPost {

  private static $current_post_id;

  private static $current_post;

  public static function init() {

    add_action( &#039;mywp_set_current_setting&#039; , array( __CLASS__ , &#039;mywp_set_current_setting&#039; ) );

  }

  public static function mywp_set_current_setting() {

    if( ! empty( $_GET[&#039;setting_post_id&#039;] ) ) {

      self::set_current_post_id( $_GET[&#039;setting_post_id&#039;] );

    } else {

      self::set_current_post_to_default();

    }

  }

  public static function get_setting_post() {

    $args = array(
      &#039;post_type&#039; =&gt; &#039;any&#039;,
      &#039;post_status&#039; =&gt; &#039;any&#039;,
      &#039;posts_per_page&#039; =&gt; 1,
      &#039;order&#039; =&gt; &#039;ASC&#039;,
      &#039;orderby&#039; =&gt; &#039;ID&#039;,
    );

    $posts = get_posts( $args );

    if( empty( $posts[0] ) ) {

      return false;

    }

    return apply_filters( &#039;mywp_setting_post&#039; , $posts[0] );

  }

  public static function set_current_post_id( $post_id = false ) {

    $post_id = (int) $post_id;

    if( empty( $post_id ) ) {

      return false;

    }

    self::$current_post_id = $post_id;

    self::set_current_post( $post_id );

  }

  public static function get_current_post_id() {

    return self::$current_post_id;

  }

  private static function set_current_post( $post_id = false ) {

    if( empty( $post_id ) ) {

      $called_text = sprintf( &#039;%s::%s( %s )&#039; , __CLASS__ , __FUNCTION__ , &#039;$post_id&#039; );

      MywpHelper::error_require_message( &#039;$post_id&#039; , $called_text );

      return false;

    }

    $post = get_post( $post_id );

    if( empty( $post ) ) {

      return false;

    }

    self::$current_post = $post;

  }

  public static function get_current_post() {

    return self::$current_post;

  }

  public static function set_current_post_to_default() {

    $post = self::get_setting_post();

    if( empty( $post-&gt;ID ) ) {

      $called_text = sprintf( &#039;%s::%s()&#039; , __CLASS__ , __FUNCTION__ , &#039;$post&#039; );

      MywpHelper::error_require_message( &#039;$post&#039; , $called_text );

      return false;

    }

    self::set_current_post_id( $post-&gt;ID );

  }

}

MywpSettingPost::init();

endif;
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
