Coder Social home page Coder Social logo

rostimelk / acf-tools Goto Github PK

View Code? Open in Web Editor NEW
144.0 10.0 17.0 230 KB

Advanced Custom Fields code made simple! ๐Ÿ™Œ

License: MIT License

JavaScript 79.08% CSS 13.81% Shell 1.55% HTML 5.57%
acf-field acf advanced-custom-fields chrome-extension wordpress

acf-tools's Introduction

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

acf-tools's People

Contributors

killawabbit avatar renewrmk avatar rostimelk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acf-tools's Issues

Taxonomy field

When returning a taxonomy field with Term-ID as return type, the generated code is broken.

`<?php
$persons_categories = get_sub_field( 'persons_categories' );

<?php $get_terms_args = array(
	'taxonomy' => 'category',
	'hide_empty' => 0,
	'include' => $taxonomy_id,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
<?php if ( $terms ) : ?>
	<?php foreach ( $terms as $term ) : ?>
		<a href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo esc_html( $term->name ); ?></a>
	<?php endforeach; ?>
<?php endif; ?>
`

GravityForms field

Hi,

The agency I work for uses ACF and Gravity Forms for every WordPress website we build.
Therefor we also always install the https://nl-be.wordpress.org/plugins/acf-gravityforms-add-on/ plugin.
It adds an extra field type to ACF and enables the user to select a specific Gravity Form from a dropdown.

Could you please support this field type in your awesome tool?
Currently when clicking the button "copy code" an alert with link to this Github appears.

The field can return a "Form object" or the "Form ID".
In case of "Form ID" the output of your tool should be something like:

<?php if ( $formID = get_{sub}_field( {fieldname} ) ): ?>
	<?php
		gravity_form(
			$formID,	// $id_or_title,
			true, 		// $display_title = true,
			true,		// $display_description = true,
			false,		// $display_inactive = false,
			null,		// $field_values = null,
			false,		// $ajax = false,
			null,		// $tabindex,
			true		// $echo = true
		);
	?>
<?php endif; ?>

Reference URL for the gravity_form function: https://docs.gravityforms.com/adding-a-form-to-the-theme-file/

Kind regards
Vinobe93

Select field

The select field is not supported, as below doesn't display anything.

<?php if ( get_field('field') == 'value' ) : ?>
<?php endif; ?>

"=" forgotten ?

Hi,
and thank you for the acf firefox extension.

I'm perhaps not that much developper as you, but I notice perhaps an error.

In the ACF plugin page, in a group of field, with a field with a repeater (3 fields inside : text, content editor, text).
So the "Copy code with sub fields" button appears on hover of the line.
When you click on it, the copied text looks like that :

`

	<?php if ( $home-section-title = get_sub_field( 'home-section-title' ) ) : ?>
		<?php echo esc_html( $home-section-title ); ?>
	<?php endif; ?>

	<?php if ( $home-section-text = get_sub_field( 'home-section-text' ) ) : ?>
		<?php echo $home-section-text; ?>
	<?php endif; ?>

	<?php if ( $home-section-button = get_sub_field( 'home-section-button' ) ) : ?>
		<?php echo esc_html( $home-section-button ); ?>
	<?php endif; ?>

<?php endwhile; ?>
`

Shouldn't the "=" be "==" ?

I hope it's helps, either I wrotte all of this for nothing !
Nicolas.

Browser history

Just wondering why I need to give the extension permission to access my browser history?

No longer work

Lately I've experienced that ACF tools no longer work?

Issue with clone field

It returns an error when trying to copy clone field or the clone field is in group or repeater field

image

Addon missing in Mozilla repository

Hi, I reinstalled Firefox today and now I can't find the ACF-TOOLS extension anywhere to download. It also disappeared from the official repository.

Is it possible to send the installation package?

Code output for Google Maps field type

When copying code for the Google Maps field type it returns an alert.

Since Google Maps requires quite a lot of configuration with ACF there is not really any good way to output code.

A modal with some steps and code to copy could be a solution.

some clarifications on acf tools:

some clarifications on acf tools:

  1. It has limitations compared to plug-ins like the famous Advanced Custom Fields: Theme Code Pro

  2. Because if I create a simple text field ACF: Theme Code Pro gives me this result
    <? php the_field ('intro_text'); ?>

and ACF Tools gives me:
<? php echo esc_url (get_field ('intro_text')); ?>

what is the difference? why does ACF Tools return me an echo?
that I know the exact form should be <? php the_field ('intro_text'); ?> or am I wrong?

basically the code is a little different between the two where is the difference?

what are these settings for?

Nice Plug-in, very useful.
Could I know what those settings are for and the difference between on / off of the same? I can't find any reference in the guide.

  • If statements for basic fields
  • Spacing on field code -> TAB | 1stace / 8 space

image

Email and image fields

First - very good and usefull extension :)

I found two 'bugs' when using.

  1. E-mail field:
    I got field with name 'email_adress'. When i copy code, i'm getting this:

the_field('email_adress');

should't i get it like this?

if ( $email_adress= get_field('email_adress') ): echo $email_adress; endif;

  1. Image field:
    Every time our variable name for image is "$image". Shouldn't it be taken from field name? For example when i have field called 'icon' it should be:

$icon= get_sub_field('icon'); if( !empty( $icon) ): <img src="echo esc_url($icon['url']); " alt="echo esc_attr($icon['alt']); " /> endif;

instead of

$image = get_sub_field('icon'); if( !empty( $image ) ): <img src="echo esc_url($image['url']); " alt="echo esc_attr($image['alt']); " /> endif;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.