| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/harmoniegolfpark.com/wp-content/plugins/acf-theme-code/render/ |
Upload File : |
<?php
// Post Object field
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
// Check if single or multiple values can be stored
// NOTE: Value is a string
$multiple_values = isset( $this->settings['multiple'] ) ? $this->settings['multiple'] : '';
// Return format
// NOTE: Not supported by ACF v4
$return_format = isset( $this->settings['return_format'] ) ? $this->settings['return_format'] : '';
// If not object (so ID or Null) and single
if( $return_format != 'object' && $multiple_values == '0' ) {
echo $this->indent . htmlspecialchars("<?php \$".$this->name. ' = ' . $this->get_field_method . "( '" . $this->name ."' ); ?>")."\n";
echo $this->indent . htmlspecialchars("<?php // var_dump( \$".$this->name." ); ?>")."\n";
}
// If not object (so ID or Null) and multiple
if( $return_format != 'object' && $multiple_values == '1' ) {
echo $this->indent . htmlspecialchars("<?php \$".$this->name.' = ' . $this->get_field_method . "( '" . $this->name ."' ); ?>")."\n";
echo $this->indent . htmlspecialchars("<?php // var_dump( \$".$this->name." ); ?>")."\n";
}
// If object and single
if( $return_format == 'object' && $multiple_values == '0' ) {
echo $this->indent . htmlspecialchars("<?php \$post_object = " . $this->get_field_method . "( '" . $this->name . "' ); ?>")."\n";
echo $this->indent . htmlspecialchars("<?php if ( \$post_object ): ?>")."\n";
echo $this->indent . htmlspecialchars(" <?php \$post = \$post_object; ?>")."\n";
echo $this->indent . htmlspecialchars(" <?php setup_postdata( \$post ); ?> ")."\n";
echo $this->indent . htmlspecialchars(" <a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a>")."\n";
echo $this->indent . htmlspecialchars(" <?php wp_reset_postdata(); ?>")."\n";
echo $this->indent . htmlspecialchars("<?php endif; ?>")."\n";
}
// If object and multiple
if( $return_format == 'object' && $multiple_values == '1' ) {
echo $this->indent . htmlspecialchars("<?php \$post_objects = " . $this->get_field_method . "( '" . $this->name . "' ); ?>")."\n";
echo $this->indent . htmlspecialchars("<?php if ( \$post_objects ): ?>")."\n";
echo $this->indent . htmlspecialchars(" <?php foreach ( \$post_objects as \$post ): ?>")."\n";
echo $this->indent . htmlspecialchars(" <?php setup_postdata( \$post ); ?>")."\n";
echo $this->indent . htmlspecialchars(" <a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?></a>")."\n";
echo $this->indent . htmlspecialchars(" <?php endforeach; ?>")."\n";
echo $this->indent . htmlspecialchars(" <?php wp_reset_postdata(); ?>")."\n";
echo $this->indent . htmlspecialchars("<?php endif; ?>")."\n";
}