Git Product home page Git Product logo

acf-cpt-options-pages's Introduction

Hi, I'm Tusko Trush wakatime tusko

πŸ”­ 10+ years experienced front-end developer.

πŸ§” Frontend Team Leader at ArtLabs Europe OÜ.

πŸ§”πŸ» Former Frontend Team Leader at AVSTrade.

πŸ‡Ό Former Wordpress/Vue3/Node.js Developer at Lab24.

πŸ’š Former Vue.js/Node.js developer at MyLab.

πŸ‡ΊπŸ‡¦ Based in Lviv, Ukraine.


JavaScript TypeScript Vue

Node PHP ElasticSearch

GitLab Github

CLI npm Gulp Webpack Vite Rollup

ESLint Jest

Tusko's GitHub stats

Tusko's GitHub contributions

🀝🏻  Get in touch

acf-cpt-options-pages's People

Contributors

davidwebca avatar ekeler avatar mrbliss66 avatar saulirajala avatar tusko 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acf-cpt-options-pages's Issues

CPT Options saving as options_ and not cpt_

Great plugin, this seems really useful. I'm having trouble pulling back the saved options in the code. I checked the database and my CTP Options are saving as options_field_name and not cpt_

Any ideas how I can debug this? In the WP-Admin I have my options pages for each CPT, and the saved data is there, but it looks like it's not stored in the DB correctly.

I did a few var_dumps in the plugin code and its finding the correct CPT, just not saving as.

Cheers!

Can't get it to work

What am I doing wrong here ...

  1. Got a custom post type called " People "
  2. Got ACF Pro
  3. People post type is checked in the CPT Options Page
  4. Created a field group and assigned it to "Options Page" which is equal to "People Options"
  5. There is a repeater field called "bottom_cards"
  6. I can see the fields in the People Options page and I entered a bunch of content.

This is the code on the archive page

<?php
if( have_rows('bottom_cards','cpt_people') ):
  while( have_rows('bottom_cards','cpt_people') ): the_row(); $row = get_row(true);
    echo $row['item_title'];
  endwhile;
endif;
?>

but nothing displays. Am I doing something wrong here?

Error in add_submenu_page

Hi,

Been using this plugin for a while, been very useful! I recently had a bug crop up on the sites I'm using this on.

PHP error:
add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position.

it seems like a fix would be on line 70 of class.acf-cpt-options-pages.php, set "position" to null instead of false. I hardcoded this fix for now for my own use but it would be great if you could implement this in a future update!

Sorry, you are not allowed to access this page.

After I successfully installed the plugin and clicked on says sorry you do not have access to this page. Then I navigated back to the plugins page and WP deactivated the plugin saying:

"The plugin ACF-CPT-Options-Pages/cpt-acf.php has been deactivated due to an error: Plugin file does not exist."

Why is the word Master added to the plugin files? Can someone send me a zip file of the plugin?

Different slug

Hello
There is a good chance that I do not understand your code but I have the impression that you changed the slug of the option pages (before: cptname-archive, now: cptname-options) which requires to reconnect the field groups on option pages. This is a major problem on a site already in production with a lot of data entered : these data will all have to be re-entered since they were recorded based on the previous slug?
Changing the name in the menus is not much, but re-enter all the data is a lot of work.

Any advice please?

Can this be used for the following:

Hi there,

Can this plugin be used for the following?

  1. Lets say i have a CPT: "series"
  2. I add a custom field (dropdown) named: Genres
  3. With the option page of this CPT the end user (my client) can add different genres.
  4. These genres are availlable when you create an new CPT item..

Am i correct?

Invalid argument supplied for foreach()

Hi! After we updated the plugin to the latest release now we keep getting the following error message:
Warning: Invalid argument supplied for foreach() in /code/web/wp-content/plugins/acf-cpt-options-pages/class.acf-cpt-options-pages.php on line 32

The only way to remove it is going in to the plugin settings page and re-save it.

Update from 1.1.1 to latest causes some issues

Hi Tusko,

First of all; thanks for this very handy plugin!
I have an issue with the latest update though; I originally had installed the plugin (version 1.1.1) from Github, and registered my CPT options in a function file like this:


/**
 * Adjust CPT Option Page Title
 * @link https://github.com/Tusko/ACF-CPT-Options-Pages
 */

function myprefix_project_archive_options($cptmenu) {
    $cptmenu['page_title'] = 'Projects Archive';
    $cptmenu['menu_title'] = 'Projects Archive';
    return $cptmenu;
}
function myprefix_dienst_archive_options($cptmenu) {
    $cptmenu['page_title'] = 'Diensten Archive';
    $cptmenu['menu_title'] = 'Diensten Archive';
    return $cptmenu;
}
function myprefix_discipline_archive_options($cptmenu) {
    $cptmenu['page_title'] = 'Disciplines Archive';
    $cptmenu['menu_title'] = 'Disciplines Archive';
    return $cptmenu;
}
function myprefix_expertise_archive_options($cptmenu) {
    $cptmenu['page_title'] = 'Expertises Archive';
    $cptmenu['menu_title'] = 'Expertises Archive';
    return $cptmenu;
}
function myprefix_vacature_archive_options($cptmenu) {
    $cptmenu['page_title'] = 'Vacature Archive';
    $cptmenu['menu_title'] = 'Vacature Archive';
    return $cptmenu;
}
add_filter('cpt_vacature_' . ICL_LANGUAGE_CODE . '_acf_page_args', 'myprefix_vacature_archive_options');
add_filter('cpt_discipline_' . ICL_LANGUAGE_CODE . '_acf_page_args', 'myprefix_discipline_archive_options');
add_filter('cpt_expertise_' . ICL_LANGUAGE_CODE . '_acf_page_args', 'myprefix_expertise_archive_options');
add_filter('cpt_project_' . ICL_LANGUAGE_CODE . '_acf_page_args', 'myprefix_project_archive_options');
add_filter('cpt_dienst_' . ICL_LANGUAGE_CODE . '_acf_page_args', 'myprefix_dienst_archive_options');

I have installed the plugin (dowloaded from Github to be precise) on a client's multisite (with WPML installed), and they updated the plugin since there was an update notice in the backend. After doing this, all option pages where no longer visible in the admin menu. I guess because these are now made with the new settings page you added for the plugin.

Adding them in the new settings page works, but then all values that where saved earlier are no longer visisble; apparently the meta keys have changed too.

I did not dive into the matter any futher so far, but thought it's worthwhile you know this is happening :-) I guess for now I'll have downgrade to the earlier version as a workaround?

Cheers, Tibor

Underscores in Menu Label

Currently there is a bug where the name of a custom post type is being shown as a label but doesn't account for other characters such as underscores, which you likely might want to avoid as the labels look slightly broken.
screen shot 2018-07-15 at 17 11 08

Can't figure out how to contribute to the project so here is the solution.

File: class.acf-cpt-options-pages.php
Below line 59 add
$name = ucfirst( str_replace('_', ' ', $name) );

How to use with Polylang

Hi.
Thanks for your plugin, it does the job very well.

However, how to translate fields with Polylang plugin ?

thank you very much

ACF-CPT-Options-Pages & WP Rest API

Hi.
I come with another request on my projet ;)

I need to retrieve the CPT option page in the rest API.
I've added acf-to-rest-api plugin. It work well.

Do you have any suggestion to retrieve this in the rest API ?

thanks for your help

Clone fields on ACF Options pages are not saving

Using 'Clone' fields to copy other fields into an Options page (Namely Flexible Content field to add content before the cpt posts).

Saving the Options page does not save the Flexible Content field data added via the clone field, and the fields are simply removed from the Flexible Content builder.

Not Translatable (WPML compatibility problems)

Hi!
This really seems like an awesome addon! But I can't get it to work with WPML. A regular option-page in ACF you can translate by switching language in the top-admin bar. But when I try to do the same whit this addon it doesn't work. Is this not supported?

Kind regards
Katarina

Overriding label in admin

As per the readme, I've added the following code to my functions.php. "locations" is the name of my custom post type. I cannot seem to get it to work. Any suggestions?

function locations_customize($cptmenu) {
    $cptmenu['page_title'] = 'Dev Custom title';
    $cptmenu['menu_title'] = 'Dev Custom title';
    return $cptmenu;
}

add_filter('locations_acf_page_args', 'locations_customize');

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.